aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Sigg <csigg@google.com>2020-11-10 12:56:50 +0100
committerChristian Sigg <csigg@google.com>2020-11-11 10:34:21 +0100
commit3307a7c046cb591dd628dd739d2f930c6943df3c (patch)
treeea6a02268541402af40d72eea85ce7b9911dd691
parent5bdb21df21c6c78554a99754ef14da06a85f9910 (diff)
downloadllvm-3307a7c046cb591dd628dd739d2f930c6943df3c.zip
llvm-3307a7c046cb591dd628dd739d2f930c6943df3c.tar.gz
llvm-3307a7c046cb591dd628dd739d2f930c6943df3c.tar.bz2
[mlir][gpu] Add missing initialization of gpu runtime wrappers.
Reviewed By: herhut Differential Revision: https://reviews.llvm.org/D91148
-rw-r--r--mlir/tools/mlir-cuda-runner/cuda-runtime-wrappers.cpp1
-rw-r--r--mlir/tools/mlir-rocm-runner/rocm-runtime-wrappers.cpp1
2 files changed, 2 insertions, 0 deletions
diff --git a/mlir/tools/mlir-cuda-runner/cuda-runtime-wrappers.cpp b/mlir/tools/mlir-cuda-runner/cuda-runtime-wrappers.cpp
index 5556700..917d203 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 d600a3f..882a4a3 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;