66//
77// ===----------------------------------------------------------------------===//
88//
9- // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t1.out
9+ // RUN: %clangxx -fsycl-device-code-split=per_kernel -fsycl -fsycl-targets=%sycl_triple %s -o %t1.out
1010// RUN: %CPU_RUN_PLACEHOLDER %t1.out
1111// RUN: %GPU_RUN_PLACEHOLDER %t1.out
1212// RUN: %ACC_RUN_PLACEHOLDER %t1.out
@@ -124,6 +124,8 @@ int main() {
124124 auto dev = q.get_device ();
125125 auto ctxt = q.get_context ();
126126
127+ const bool DoublesSupported = dev.has (sycl::aspect::fp64);
128+
127129 test_struct test_obj{4 , 42 , 424 , 4242 , 4 .2f , 4.242 , 4.24242 };
128130
129131 if (dev.get_info <info::device::usm_host_allocations>()) {
@@ -133,8 +135,10 @@ int main() {
133135 runHostTests<long long >(dev, ctxt, q, 4242 );
134136 runHostTests<sycl::half>(dev, ctxt, q, sycl::half (4 .2f ));
135137 runHostTests<float >(dev, ctxt, q, 4 .242f );
136- runHostTests<double >(dev, ctxt, q, 4.24242 );
137- runHostTests<test_struct>(dev, ctxt, q, test_obj);
138+ if (DoublesSupported) {
139+ runHostTests<double >(dev, ctxt, q, 4.24242 );
140+ runHostTests<test_struct>(dev, ctxt, q, test_obj);
141+ }
138142 }
139143
140144 if (dev.get_info <info::device::usm_shared_allocations>()) {
@@ -144,8 +148,10 @@ int main() {
144148 runSharedTests<long long >(dev, ctxt, q, 4242 );
145149 runSharedTests<sycl::half>(dev, ctxt, q, sycl::half (4 .2f ));
146150 runSharedTests<float >(dev, ctxt, q, 4 .242f );
147- runSharedTests<double >(dev, ctxt, q, 4.24242 );
148- runSharedTests<test_struct>(dev, ctxt, q, test_obj);
151+ if (DoublesSupported) {
152+ runSharedTests<double >(dev, ctxt, q, 4.24242 );
153+ runSharedTests<test_struct>(dev, ctxt, q, test_obj);
154+ }
149155 }
150156
151157 if (dev.get_info <info::device::usm_device_allocations>()) {
@@ -155,8 +161,10 @@ int main() {
155161 runDeviceTests<long long >(dev, ctxt, q, 4242 );
156162 runDeviceTests<sycl::half>(dev, ctxt, q, sycl::half (4 .2f ));
157163 runDeviceTests<float >(dev, ctxt, q, 4 .242f );
158- runDeviceTests<double >(dev, ctxt, q, 4.24242 );
159- runDeviceTests<test_struct>(dev, ctxt, q, test_obj);
164+ if (DoublesSupported) {
165+ runDeviceTests<double >(dev, ctxt, q, 4.24242 );
166+ runDeviceTests<test_struct>(dev, ctxt, q, test_obj);
167+ }
160168 }
161169
162170 return 0 ;
0 commit comments