Skip to content

Commit db20bab

Browse files
authored
[SYCL][CUDA] cl_khr_fp16 extension connected to cuda PI. (intel#4029)
This change ensures that the fp16 Reduction test case runs for the cuda backend. The test fp16-with-unnamed-lambda.cpp has been deleted because it has a duplicate in the test suite (in the dir SYCL/Regression). In both cases the triple is missing on the first line which needs to be added to the llvm-test-suite copy to avoid a test failure now that the test is not skipped for the cuda backend. Signed-off-by: JackAKirk <[email protected]>
1 parent 8fe7dd9 commit db20bab

File tree

2 files changed

+16
-43
lines changed

2 files changed

+16
-43
lines changed

sycl/plugins/cuda/pi_cuda.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1378,6 +1378,22 @@ pi_result cuda_piDeviceGetInfo(pi_device device, pi_device_info param_name,
13781378

13791379
std::string SupportedExtensions = "cl_khr_fp64 ";
13801380

1381+
int major = 0;
1382+
int minor = 0;
1383+
1384+
cl::sycl::detail::pi::assertion(
1385+
cuDeviceGetAttribute(&major,
1386+
CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR,
1387+
device->get()) == CUDA_SUCCESS);
1388+
cl::sycl::detail::pi::assertion(
1389+
cuDeviceGetAttribute(&minor,
1390+
CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR,
1391+
device->get()) == CUDA_SUCCESS);
1392+
1393+
if ((major >= 6) || ((major == 5) && (minor >= 3))) {
1394+
SupportedExtensions += "cl_khr_fp16 ";
1395+
}
1396+
13811397
return getInfo(param_value_size, param_value, param_value_size_ret,
13821398
SupportedExtensions.c_str());
13831399
}

sycl/test/regression/fp16-with-unnamed-lambda.cpp

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)