From db522a2fbc7cb295bbb4ba6f8230fea574e77725 Mon Sep 17 00:00:00 2001
From: foreman
Date: Sun, 22 Apr 2018 21:17:27 -0400
Subject: [PATCH] P4 to Git Change 1544858 by skudchad@skudchad_rocm on
2018/04/22 21:07:25
SWDEV-144570 - [HIP] - Fix a few APIs and typos.
Affected files ...
... //depot/stg/opencl/drivers/opencl/api/hip/hip_device_runtime.cpp#6 edit
... //depot/stg/opencl/drivers/opencl/api/hip/hip_platform.cpp#6 edit
---
hipamd/api/hip/hip_device_runtime.cpp | 16 ++++++++++++----
hipamd/api/hip/hip_platform.cpp | 2 ++
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/hipamd/api/hip/hip_device_runtime.cpp b/hipamd/api/hip/hip_device_runtime.cpp
index d0d9c1145b..effce5974f 100644
--- a/hipamd/api/hip/hip_device_runtime.cpp
+++ b/hipamd/api/hip/hip_device_runtime.cpp
@@ -349,9 +349,9 @@ hipError_t hipDeviceGetStreamPriorityRange ( int* leastPriority, int* greatestPr
hipError_t hipDeviceReset ( void ) {
HIP_INIT_API();
- assert(0 && "Unimplemented");
+ /* FIXME */
- return hipErrorUnknown;
+ return hipSuccess;
}
hipError_t hipDeviceSetCacheConfig ( hipFuncCache_t cacheConfig ) {
@@ -429,13 +429,21 @@ hipError_t hipSetDevice ( int device ) {
return hipSuccess;
}
- return hipErrorInvalidValue;
+ return hipErrorInvalidDevice;
}
hipError_t hipSetDeviceFlags ( unsigned int flags ) {
HIP_INIT_API(flags);
- assert(0 && "Unimplemented");
+ /* FIXME */
+ /* Not all of Ctx may be implemented */
+
+ unsigned supportedFlags =
+ hipDeviceScheduleMask | hipDeviceMapHost | hipDeviceLmemResizeToMax;
+
+ if (flags & (~supportedFlags)) {
+ return hipErrorInvalidValue;
+ }
return hipSuccess;
}
diff --git a/hipamd/api/hip/hip_platform.cpp b/hipamd/api/hip/hip_platform.cpp
index d66bf0930c..a9c52bac2e 100644
--- a/hipamd/api/hip/hip_platform.cpp
+++ b/hipamd/api/hip/hip_platform.cpp
@@ -272,6 +272,8 @@ void hipLaunchKernelGGLImpl(
uint32_t sharedMemBytes,
hipStream_t stream,
void** kernarg) {
+
+ assert(0 && "Unimplemented");
}
}