Closed zjin-lcf closed 1 year ago
Hi @zjin-lcf,
As far as I know there are no similar functions in SYCL. You can use event::get_profiling_info
to get various info about command group execution. It allows you to measure kernel execution time, but it won't allow you to measure time of a certain segment of a kernel.
Please also note that profiling info must be enabled when creating a queue.
I hope that the SYCL specification team will add them. Thank you.
https://medium.com/rapids-ai/extending-numbas-cuda-target-with-the-high-level-api-cc9309b129a1
Does the SYCL compiler allow people to add intrinsics in the kernel ?
Does the SYCL compiler allow people to add intrinsics in the kernel ?
It would be good to align on the meaning of "intrinsic" here. Essentially, if you know that device compiler for a target you are interested in supports some built-in functions, then you can technically declare them in your application as SYCL_EXTERNAL
functions and call them.
Some of our experimental features are implemented this way: https://github.com/intel/llvm/blob/37960cda2d6c190cfe30c3e199ecc20fed7f03f6/sycl/include/sycl/ext/oneapi/experimental/invoke_simd.hpp#L31-L55
If you are interested in injecting some inline assembly into your kernel, then it should also be possible, theoretically. I say theoretically, because we do support that for Intel GPUs, for example and have corresponding tests: InlineAsm, but I haven't seen any examples with inline asm for CUDA devices, so I don't know if it really works there.
Most users don't necessarily know about the compiler implementations. Examples with inline asm for CUDA/HIP devices are very helpful for users.
I hope that the SYCL specification team will add them. Thank you.
@zjin-lcf, we have noted this feature request internally, but if you want this functionality to be a core part of the specification, then it perhaps worth to submit an issue against KhronosGroup/SYCL-Docs repo.
Most users don't necessarily know about the compiler implementations. Examples with inline asm for CUDA/HIP devices are very helpful for users.
@intel/llvm-reviewers-cuda, do you know if inline asm works for CUDA/HIP?
Are there time functions (e.g. clock() and clock64()) in SYCL ?
Reference http://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#time-function