Open zjin-lcf opened 1 year ago
Perhaps adding something more modern C++ than a cycle count? What happens if the the frequency change? What if this feature is not provided by the hardware? You can use some CUDA interoperability mode in the meantime if an implementation provides it.
I agree with @keryell here.
If you have better ideas about the support of the time() function. Please add it to the SYCL spec.
I don't understand the point of "not provided by hardware". Will a feature in the specification exist after it is provided by hardware?
I understand that the SYCL specification is creative work by people. For the time() function, it is catching up with CUDA/HIP.
Sure. But Khronos is not targeting CUDA or a clone. This is why the standards target common hardware features only and address others with some Khronos or vendor extensions. I do not think it is available in OpenCL C kernel language either. On an FPGA you could make one by yourself, by adding a clock kernel connected by some SYCL pipes (Intel extension) and just incrementing a counter forever. :-) Or on GPU by a kernel you launch and forget which would increment atomically a counter in a buffer or a global device variable (Intel extension).
Time functions (e.g. clock() and clock64()) may be added to the SYCL specification.
Reference http://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#time-function