|
18 | 18 | /// \author Devajith Valaparambil Sreeramaswamy (CERN) |
19 | 19 |
|
20 | 20 | #define ROOT_MATH_ARCH MathSYCL |
| 21 | +#define ROOT_MATH_SYCL |
21 | 22 |
|
22 | 23 | #include "MathX/Vector3D.h" |
23 | 24 | #include "MathX/Point3D.h" |
@@ -220,16 +221,31 @@ int testLorentzVector() |
220 | 221 | << " Lorentz Vector Tests" |
221 | 222 | << "\n************************************************************************\n"; |
222 | 223 |
|
223 | | - LorentzVector<PtEtaPhiM4D<float>> v1(1, 2, 3, 4); |
224 | | - LorentzVector<PtEtaPhiM4D<float>> v2(5, 6, 7, 8); |
225 | | - ok += compare(v1.DeltaR(v2), 4.60575f); |
226 | | - // Result cross-validated using: |
227 | | - // TLorentzVector t1, t2; |
228 | | - // t1.SetPtEtaPhiE(1,2,3,4); t2.SetPtEtaPhiE(5,6,7,8); |
229 | | - // t1.DeltaR(t2) |
| 224 | + sycl::buffer<int, 1> ok_buf(&ok, sycl::range<1>(1)); |
| 225 | + sycl::default_selector device_selector; |
| 226 | + sycl::queue queue(device_selector); |
| 227 | + |
| 228 | + std::cout << "sycl::queue check - selected device:\n" |
| 229 | + << queue.get_device().get_info<sycl::info::device::name>() << std::endl; |
| 230 | + |
| 231 | + { |
| 232 | + queue.submit([&](sycl::handler &cgh) { |
| 233 | + auto ok_device = ok_buf.get_access<sycl::access::mode::read_write>(cgh); |
| 234 | + cgh.single_task<class testRotations3D>([=]() { |
| 235 | + LorentzVector<PtEtaPhiM4D<float>> v1(1, 2, 3, 4); |
| 236 | + LorentzVector<PtEtaPhiM4D<float>> v2(5, 6, 7, 8); |
| 237 | + ok_device[0] += compare(v1.DeltaR(v2), 4.60575f); |
| 238 | + |
| 239 | + LorentzVector<PtEtaPhiM4D<float>> v = v1 + v2; |
| 240 | + ok_device[0] += compare(v.M(), 62.03058f); |
| 241 | + }); |
| 242 | + }); |
| 243 | + } |
230 | 244 |
|
231 | 245 | if (ok == 0) |
232 | | - std::cout << "\t OK " << std::endl; |
| 246 | + std::cout << "\tOK\n"; |
| 247 | + else |
| 248 | + std::cout << "\t FAILED\n"; |
233 | 249 |
|
234 | 250 | return ok; |
235 | 251 | } |
|
0 commit comments