@@ -23,7 +23,7 @@ using shared_allocator = sycl::usm_allocator<DataT, sycl::usm::alloc::shared>;
23
23
template <typename DataT>
24
24
using shared_vector = std::vector<DataT, shared_allocator<DataT>>;
25
25
26
- int test_rdtsc_sr0 () {
26
+ int test_rdtsc () {
27
27
sycl::queue Queue;
28
28
shared_allocator<uint64_t > Allocator (Queue);
29
29
constexpr int32_t SIZE = 32 ;
@@ -41,12 +41,10 @@ int test_rdtsc_sr0() {
41
41
auto Kernel = ([=](sycl::nd_item<1 > ndi) [[intel::sycl_explicit_simd]] {
42
42
using namespace sycl ::ext::intel::esimd;
43
43
auto Idx = ndi.get_global_id (0 );
44
- simd<uint64_t , SIZE> DummyVector;
45
44
uint64_t StartCounter = sycl::ext::intel::experimental::esimd::rdtsc ();
46
- DummyVector. copy_from (VectorOutputRDTSCPtr);
45
+ simd< uint64_t , 1 > VectorResultRDTSC (VectorOutputRDTSCPtr + Idx );
47
46
uint64_t EndCounter = sycl::ext::intel::experimental::esimd::rdtsc ();
48
-
49
- simd<uint64_t , 1 > VectorResultRDTSC = EndCounter - StartCounter;
47
+ VectorResultRDTSC = EndCounter > StartCounter;
50
48
51
49
VectorResultRDTSC.copy_to (VectorOutputRDTSCPtr + Idx);
52
50
});
@@ -60,16 +58,14 @@ int test_rdtsc_sr0() {
60
58
61
59
// Check if returned values are positive
62
60
Result |= std::any_of (VectorOutputRDTSC.begin (), VectorOutputRDTSC.end (),
63
- [](uint64_t v) { return v < = 0 ; });
61
+ [](uint64_t v) { return v = = 0 ; });
64
62
65
63
return Result;
66
64
}
67
65
68
66
int main () {
69
67
70
- int TestResult = 0 ;
71
-
72
- TestResult |= test_rdtsc_sr0 ();
68
+ int TestResult = test_rdtsc ();
73
69
74
70
if (!TestResult) {
75
71
std::cout << " Pass" << std::endl;
0 commit comments