From e402523e67e9bb91ec44d714ab4d57a9ecf2effe Mon Sep 17 00:00:00 2001 From: Pierre-Andre Saulais Date: Thu, 1 Feb 2024 12:33:29 +0000 Subject: [PATCH] [UR][CUDA] Use new variant of the enableCUDATracing function (#12521) https://github.com/oneapi-src/unified-runtime/pull/1070 and https://github.com/intel/llvm/pull/11952 introduced a new variant of the `enableCUDATracing` function that takes a context pointer parameter, replacing the parameterless variant of that function. The older variant will be removed from UR once this PR is merged. --- sycl/plugins/cuda/pi_cuda.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sycl/plugins/cuda/pi_cuda.cpp b/sycl/plugins/cuda/pi_cuda.cpp index 4b8163b03efbd..6d50d120aa2f9 100644 --- a/sycl/plugins/cuda/pi_cuda.cpp +++ b/sycl/plugins/cuda/pi_cuda.cpp @@ -17,7 +17,12 @@ #include // Forward declarations -void enableCUDATracing(); +struct cuda_tracing_context_t_; + +void enableCUDATracing(cuda_tracing_context_t_ *ctx); +void disableCUDATracing(cuda_tracing_context_t_ *ctx); +cuda_tracing_context_t_ *createCUDATracingContext(); +void freeCUDATracingContext(cuda_tracing_context_t_ *Ctx); //-- PI API implementation extern "C" { @@ -1237,7 +1242,8 @@ pi_result piPluginInit(pi_plugin *PluginInit) { std::memset(&(PluginInit->PiFunctionTable), 0, sizeof(PluginInit->PiFunctionTable)); - enableCUDATracing(); + cuda_tracing_context_t_ *Ctx = createCUDATracingContext(); + enableCUDATracing(Ctx); // Forward calls to CUDA RT. #define _PI_API(api) \