Skip to content

Commit

Permalink
Merge pull request #2729 from ROCm/r2.18-rocm-buf-init-fix
Browse files Browse the repository at this point in the history
buffer_comparator buffer init fix
  • Loading branch information
i-chaochen authored Oct 28, 2024
2 parents 30f6503 + d14ab22 commit 2db2d9d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
12 changes: 8 additions & 4 deletions third_party/xla/xla/service/gpu/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2263,11 +2263,15 @@ xla_cc_test(
],
)

cuda_library(
gpu_kernel_library(
name = "stream_executor_util_kernel",
srcs = ["stream_executor_util_kernel.cu.cc"],
tags = ["cuda-only"],
deps = ["@local_config_cuda//cuda:cuda_headers"],
tags = ["gpu"],
deps = if_cuda_is_configured([
"@local_config_cuda//cuda:cuda_headers",
]) + if_rocm_is_configured([
"@local_config_rocm//rocm:rocm_headers",
]),
)

cc_library(
Expand Down Expand Up @@ -2308,7 +2312,7 @@ cc_library(
"@local_tsl//tsl/platform:status",
"@local_tsl//tsl/platform:statusor",
"@local_tsl//tsl/protobuf:dnn_proto_cc",
] + if_cuda_is_configured([
] + if_gpu_is_configured([
":stream_executor_util_kernel",
]),
)
Expand Down
6 changes: 5 additions & 1 deletion third_party/xla/xla/service/gpu/kernels/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,11 @@ gpu_kernel_library(
"//xla:types",
"//xla/stream_executor/gpu:gpu_types_header",
"//xla/tsl/lib/math:math_util",
],
] + if_cuda_is_configured([
"@local_config_cuda//cuda:cuda_headers",
]) + if_rocm_is_configured([
"@local_config_rocm//rocm:rocm_headers",
]),
)

xla_test(
Expand Down
2 changes: 0 additions & 2 deletions third_party/xla/xla/service/gpu/stream_executor_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,6 @@ static void InitializeTypedBuffer(se::Stream* stream,
// Nothing more to do
return;
}
#ifdef GOOGLE_CUDA
// Repeat the host_buffer_size elements at the start of `buf` to the end
CHECK_EQ(elements_to_fill, buffer.size() / sizeof(T) - host_buffer_size);
se::StreamExecutor* executor = stream->parent();
Expand All @@ -514,7 +513,6 @@ static void InitializeTypedBuffer(se::Stream* stream,
se::BlockDim(blocks_per_grid, 1, 1), *kernel,
buffer, host_buffer_bytes,
static_cast<int64_t>(buffer.size())));
#endif
}

void InitializeBuffer(se::Stream* stream, PrimitiveType buffer_type,
Expand Down

0 comments on commit 2db2d9d

Please sign in to comment.