Skip to content

Commit c9ced2d

Browse files
committed
Address PR comments
1 parent ea9ded8 commit c9ced2d

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

sycl/test-e2e/ESIMD/rdtsc.cpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ using shared_allocator = sycl::usm_allocator<DataT, sycl::usm::alloc::shared>;
2323
template <typename DataT>
2424
using shared_vector = std::vector<DataT, shared_allocator<DataT>>;
2525

26-
int test_rdtsc_sr0() {
26+
int test_rdtsc() {
2727
sycl::queue Queue;
2828
shared_allocator<uint64_t> Allocator(Queue);
2929
constexpr int32_t SIZE = 32;
@@ -41,12 +41,10 @@ int test_rdtsc_sr0() {
4141
auto Kernel = ([=](sycl::nd_item<1> ndi) [[intel::sycl_explicit_simd]] {
4242
using namespace sycl::ext::intel::esimd;
4343
auto Idx = ndi.get_global_id(0);
44-
simd<uint64_t, SIZE> DummyVector;
4544
uint64_t StartCounter = sycl::ext::intel::experimental::esimd::rdtsc();
46-
DummyVector.copy_from(VectorOutputRDTSCPtr);
45+
simd<uint64_t, 1> VectorResultRDTSC(VectorOutputRDTSCPtr + Idx);
4746
uint64_t EndCounter = sycl::ext::intel::experimental::esimd::rdtsc();
48-
49-
simd<uint64_t, 1> VectorResultRDTSC = EndCounter - StartCounter;
47+
VectorResultRDTSC = EndCounter > StartCounter;
5048

5149
VectorResultRDTSC.copy_to(VectorOutputRDTSCPtr + Idx);
5250
});
@@ -60,16 +58,14 @@ int test_rdtsc_sr0() {
6058

6159
// Check if returned values are positive
6260
Result |= std::any_of(VectorOutputRDTSC.begin(), VectorOutputRDTSC.end(),
63-
[](uint64_t v) { return v <= 0; });
61+
[](uint64_t v) { return v == 0; });
6462

6563
return Result;
6664
}
6765

6866
int main() {
6967

70-
int TestResult = 0;
71-
72-
TestResult |= test_rdtsc_sr0();
68+
int TestResult = test_rdtsc();
7369

7470
if (!TestResult) {
7571
std::cout << "Pass" << std::endl;

0 commit comments

Comments
 (0)