Skip to content

Commit b1a8a7d

Browse files
author
JackAKirk
committed
Revert "cl_khr_fp64 and cl_khr_fp16 extensions are now connected to the cuda plugin."
This reverts commit 80c8508.
1 parent 80c8508 commit b1a8a7d

File tree

2 files changed

+44
-20
lines changed

2 files changed

+44
-20
lines changed

sycl/plugins/cuda/pi_cuda.cpp

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1371,26 +1371,7 @@ pi_result cuda_piDeviceGetInfo(pi_device device, pi_device_info param_name,
13711371
return getInfo(param_value_size, param_value, param_value_size_ret, "");
13721372
}
13731373
case PI_DEVICE_INFO_EXTENSIONS: {
1374-
1375-
std::string SupportedExtensions = "cl_khr_fp64 ";
1376-
int major = 0;
1377-
int minor = 0;
1378-
1379-
cl::sycl::detail::pi::assertion(
1380-
cuDeviceGetAttribute(&major,
1381-
CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR,
1382-
device->get()) == CUDA_SUCCESS);
1383-
cl::sycl::detail::pi::assertion(
1384-
cuDeviceGetAttribute(&minor,
1385-
CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR,
1386-
device->get()) == CUDA_SUCCESS);
1387-
1388-
if ((major >= 6) || ((major == 5) && (minor >= 3))) {
1389-
SupportedExtensions += "cl_khr_fp16 ";
1390-
}
1391-
1392-
return getInfo(param_value_size, param_value, param_value_size_ret,
1393-
SupportedExtensions.c_str());
1374+
return getInfo(param_value_size, param_value, param_value_size_ret, "");
13941375
}
13951376
case PI_DEVICE_INFO_PRINTF_BUFFER_SIZE: {
13961377
// The minimum value for the FULL profile is 1 MB.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// RUN: %clangxx -fsycl -fsycl-unnamed-lambda %s -o %t.out
2+
// RUN: %RUN_ON_HOST %t.out
3+
#include <CL/sycl.hpp>
4+
5+
#include <iostream>
6+
7+
int main() {
8+
auto AsyncHandler = [](cl::sycl::exception_list EL) {
9+
for (std::exception_ptr const &P : EL) {
10+
try {
11+
std::rethrow_exception(P);
12+
} catch (std::exception const &E) {
13+
std::cerr << "Caught async SYCL exception: " << E.what() << std::endl;
14+
}
15+
}
16+
};
17+
18+
cl::sycl::queue Q(AsyncHandler);
19+
20+
cl::sycl::device D = Q.get_device();
21+
if (!D.has_extension("cl_khr_fp16"))
22+
return 0; // Skip the test if halfs are not supported
23+
24+
cl::sycl::buffer<cl::sycl::cl_half> Buf(1);
25+
26+
Q.submit([&](cl::sycl::handler &CGH) {
27+
auto Acc = Buf.get_access<cl::sycl::access::mode::write>(CGH);
28+
CGH.single_task([=]() {
29+
Acc[0] = 1;
30+
});
31+
});
32+
33+
Q.wait_and_throw();
34+
35+
auto Acc = Buf.get_access<cl::sycl::access::mode::read>();
36+
if (1 != Acc[0]) {
37+
std::cerr << "Incorrect result, got: " << Acc[0]
38+
<< ", expected: 1" << std::endl;
39+
return 1;
40+
}
41+
42+
return 0;
43+
}

0 commit comments

Comments
 (0)