[Mlir-commits] [mlir] 3307a7c - [mlir][gpu] Add missing initialization of gpu runtime wrappers.

Christian Sigg llvmlistbot at llvm.org
Wed Nov 11 01:34:31 PST 2020


Author: Christian Sigg
Date: 2020-11-11T10:34:21+01:00
New Revision: 3307a7c046cb591dd628dd739d2f930c6943df3c

URL: https://github.com/llvm/llvm-project/commit/3307a7c046cb591dd628dd739d2f930c6943df3c
DIFF: https://github.com/llvm/llvm-project/commit/3307a7c046cb591dd628dd739d2f930c6943df3c.diff

LOG: [mlir][gpu] Add missing initialization of gpu runtime wrappers.

Reviewed By: herhut

Differential Revision: https://reviews.llvm.org/D91148

Added: 
    

Modified: 
    mlir/tools/mlir-cuda-runner/cuda-runtime-wrappers.cpp
    mlir/tools/mlir-rocm-runner/rocm-runtime-wrappers.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/tools/mlir-cuda-runner/cuda-runtime-wrappers.cpp b/mlir/tools/mlir-cuda-runner/cuda-runtime-wrappers.cpp
index 55567001aeae..917d203298c5 100644
--- a/mlir/tools/mlir-cuda-runner/cuda-runtime-wrappers.cpp
+++ b/mlir/tools/mlir-cuda-runner/cuda-runtime-wrappers.cpp
@@ -34,6 +34,7 @@
 
 // Static initialization of CUDA context for device ordinal 0.
 static auto InitializeCtx = [] {
+  CUDA_REPORT_IF_ERROR(cuInit(/*flags=*/0));
   CUdevice device;
   CUDA_REPORT_IF_ERROR(cuDeviceGet(&device, /*ordinal=*/0));
   CUcontext context;

diff  --git a/mlir/tools/mlir-rocm-runner/rocm-runtime-wrappers.cpp b/mlir/tools/mlir-rocm-runner/rocm-runtime-wrappers.cpp
index d600a3fd8fa2..882a4a34d2dc 100644
--- a/mlir/tools/mlir-rocm-runner/rocm-runtime-wrappers.cpp
+++ b/mlir/tools/mlir-rocm-runner/rocm-runtime-wrappers.cpp
@@ -33,6 +33,7 @@
 
 // Static initialization of HIP context for device ordinal 0.
 static auto InitializeCtx = [] {
+  HIP_REPORT_IF_ERROR(hipInit(/*flags=*/0));
   hipDevice_t device;
   HIP_REPORT_IF_ERROR(hipDeviceGet(&device, /*ordinal=*/0));
   hipContext_t context;


        


More information about the Mlir-commits mailing list