Skip to content

Commit 3c0a0f1

Browse files
authored
[SYCL][CUDA] Fix selected_binary argument in piextDeviceSelectBinary (#1475)
selected_binary argument for piextDeviceSelectBinary should be binary index Signed-off-by: hiaselhans <simon.klemenc@gmail.com>
1 parent 1cca686 commit 3c0a0f1

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

sycl/plugins/cuda/pi_cuda.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -791,23 +791,20 @@ pi_result cuda_piDevicePartition(
791791
pi_result cuda_piextDeviceSelectBinary(pi_device device,
792792
pi_device_binary *binaries,
793793
pi_uint32 num_binaries,
794-
pi_device_binary *selected_binary) {
794+
pi_uint32 *selected_binary) {
795795
if (!binaries) {
796796
cl::sycl::detail::pi::die("No list of device images provided");
797797
}
798798
if (num_binaries < 1) {
799799
cl::sycl::detail::pi::die("No binary images in the list");
800800
}
801-
if (!selected_binary) {
802-
cl::sycl::detail::pi::die("No storage for device binary provided");
803-
}
804801

805802
// Look for an image for the NVPTX64 target, and return the first one that is
806803
// found
807804
for (pi_uint32 i = 0; i < num_binaries; i++) {
808805
if (strcmp(binaries[i]->DeviceTargetSpec,
809806
PI_DEVICE_BINARY_TARGET_NVPTX64) == 0) {
810-
*selected_binary = binaries[i];
807+
*selected_binary = i;
811808
return PI_SUCCESS;
812809
}
813810
}

0 commit comments

Comments
 (0)