Enabling hipGetDeviceFlags required in [SWDEV-229170]

Change-Id: I998d37e5847f9651345554bada86df6fce86d1eb


[ROCm/clr commit: 94699a7a6f]
Этот коммит содержится в:
Sarbojit Sarkar
2020-05-07 03:57:58 -04:00
родитель 090826f5dc
Коммит 8ea2da75d2
6 изменённых файлов: 28 добавлений и 4 удалений
+8
Просмотреть файл
@@ -506,6 +506,14 @@ hipError_t hipFuncSetCacheConfig(const void* func, hipFuncCache_t config);
*/
hipError_t hipDeviceGetSharedMemConfig(hipSharedMemConfig* pConfig);
/**
* @brief Gets the flags set for current device
*
* @param [out] flags
*
* @returns #hipSuccess, #hipErrorInvalidDevice, #hipErrorInvalidValue
*/
hipError_t hipGetDeviceFlags(unsigned *flags);
/**
* @brief The bank width of shared memory on current device is set
+4
Просмотреть файл
@@ -1511,6 +1511,10 @@ inline static hipError_t hipProfilerStart() { return hipCUDAErrorTohipError(cuda
inline static hipError_t hipProfilerStop() { return hipCUDAErrorTohipError(cudaProfilerStop()); }
inline static hipError_t hipGetDeviceFlags(unsigned int* flags) {
return hipCUDAErrorTohipError(cudaGetDeviceFlags(flags));
}
inline static hipError_t hipSetDeviceFlags(unsigned int flags) {
return hipCUDAErrorTohipError(cudaSetDeviceFlags(flags));
}
+8 -2
Просмотреть файл
@@ -471,7 +471,12 @@ hipError_t hipGetDeviceCount ( int* count ) {
}
hipError_t hipGetDeviceFlags ( unsigned int* flags ) {
HIP_RETURN(hipErrorNotSupported);
HIP_INIT_API(hipGetDeviceFlags, flags);
if (flags == nullptr) {
HIP_RETURN(hipErrorInvalidValue);
}
*flags = hip::getCurrentDevice()->getFlags();
HIP_RETURN(hipSuccess);
}
hipError_t hipIpcGetEventHandle ( hipIpcEventHandle_t* handle, hipEvent_t event ) {
@@ -531,7 +536,8 @@ hipError_t hipSetDeviceFlags ( unsigned int flags ) {
default:
break;
}
hip::getCurrentDevice()->setFlags(flags & hipDeviceScheduleMask);
HIP_RETURN(hipSuccess);
}
+1
Просмотреть файл
@@ -149,6 +149,7 @@ hipPointerGetAttributes
hipProfilerStart
hipProfilerStop
hipRuntimeGetVersion
hipGetDeviceFlags
hipSetDevice
hipSetDeviceFlags
hipStreamAddCallback
+1
Просмотреть файл
@@ -149,6 +149,7 @@ global:
hipProfilerStart;
hipProfilerStop;
hipRuntimeGetVersion;
hipGetDeviceFlags;
hipSetDevice;
hipSetDeviceFlags;
hipStreamAddCallback;
+6 -2
Просмотреть файл
@@ -119,12 +119,14 @@ namespace hip {
int deviceId_;
/// ROCclr host queue for default streams
Stream null_stream_;
//Maintain list of user enabled peers
/// Store device flags
unsigned int flags_;
/// Maintain list of user enabled peers
std::list<int> userEnabledPeers;
public:
Device(amd::Context* ctx, int devId):
context_(ctx), deviceId_(devId), null_stream_(this, amd::CommandQueue::Priority::Normal, 0, true)
context_(ctx), deviceId_(devId), null_stream_(this, amd::CommandQueue::Priority::Normal, 0, true), flags_(hipDeviceScheduleSpin)
{ assert(ctx != nullptr); }
~Device() {}
@@ -152,6 +154,8 @@ namespace hip {
return hipErrorPeerAccessNotEnabled;
}
}
unsigned int getFlags() const { return flags_; }
void setFlags(unsigned int flags) { flags_ = flags; }
amd::HostQueue* NullStream(bool skip_alloc = false);
};