This repository was archived by the owner on Mar 28, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +10
-13
lines changed Expand file tree Collapse file tree 2 files changed +10
-13
lines changed Original file line number Diff line number Diff line change @@ -349,9 +349,6 @@ int main(int argc, char *argv[]) {
349
349
return 0 ;
350
350
}
351
351
352
- bool doubleIsSupported = q.get_device ().has (sycl::aspect::fp64);
353
- bool halfIsSupported = q.get_device ().has (sycl::aspect::fp16);
354
-
355
352
std::vector<int > sizes{1 , 12 , 32 };
356
353
357
354
for (int i = 0 ; i < sizes.size (); ++i) {
@@ -360,9 +357,9 @@ int main(int argc, char *argv[]) {
360
357
test_sort_by_type<std::int32_t >(q, sizes[i]);
361
358
test_sort_by_type<std::uint32_t >(q, sizes[i]);
362
359
test_sort_by_type<float >(q, sizes[i]);
363
- if (halfIsSupported )
360
+ if (q. get_device (). has (sycl::aspect::fp16) )
364
361
test_sort_by_type<sycl::half>(q, sizes[i]);
365
- if (doubleIsSupported )
362
+ if (q. get_device (). has (sycl::aspect::fp64) )
366
363
test_sort_by_type<double >(q, sizes[i]);
367
364
test_sort_by_type<std::size_t >(q, sizes[i]);
368
365
Original file line number Diff line number Diff line change @@ -12,27 +12,27 @@ union TestUnion {
12
12
public:
13
13
int myint;
14
14
char mychar;
15
- float myfloat ;
15
+ double mydouble ;
16
16
17
- TestUnion () { myfloat = 0.0 ; };
17
+ TestUnion () { mydouble = 0.0 ; };
18
18
};
19
19
20
20
int main (int argc, char **argv) {
21
21
TestUnion x;
22
- x.myfloat = 5.0 ;
23
- float myfloat = 0.0 ;
22
+ x.mydouble = 5.0 ;
23
+ double mydouble = 0.0 ;
24
24
25
25
sycl::queue queue;
26
26
{
27
- sycl::buffer<float , 1 > buf (&myfloat , 1 );
27
+ sycl::buffer<double , 1 > buf (&mydouble , 1 );
28
28
queue.submit ([&](sycl::handler &cgh) {
29
29
auto acc = buf.get_access <sycl::access::mode::read_write>(cgh);
30
- cgh.single_task <class test >([=]() { acc[0 ] = x.myfloat ; });
30
+ cgh.single_task <class test >([=]() { acc[0 ] = x.mydouble ; });
31
31
});
32
32
}
33
33
34
- if (myfloat != 5.0 ) {
35
- printf (" FAILED\n myfloat = %d\n " , myfloat );
34
+ if (mydouble != 5.0 ) {
35
+ printf (" FAILED\n mydouble = %d\n " , mydouble );
36
36
return 1 ;
37
37
}
38
38
return 0 ;
You can’t perform that action at this time.
0 commit comments