P4 to Git Change 1777158 by cpaquot@cpaquot-ocl-lc-lnx on 2019/05/01 17:12:01
SWDEV-188219 - [HIP] Add hipStreamCreateWithPriority. NOP right now. Affected files ... ... //depot/stg/opencl/drivers/opencl/api/hip/hip_device_runtime.cpp#14 edit ... //depot/stg/opencl/drivers/opencl/api/hip/hip_hcc.def.in#13 edit ... //depot/stg/opencl/drivers/opencl/api/hip/hip_hcc.map.in#14 edit ... //depot/stg/opencl/drivers/opencl/api/hip/hip_stream.cpp#17 edit ... //depot/stg/opencl/drivers/opencl/runtime/platform/commandqueue.hpp#21 edit
This commit is contained in:
@@ -343,11 +343,6 @@ hipError_t hipDeviceGetSharedMemConfig ( hipSharedMemConfig * pConfig ) {
|
||||
HIP_RETURN(hipSuccess);
|
||||
}
|
||||
|
||||
hipError_t hipDeviceGetStreamPriorityRange ( int* leastPriority, int* greatestPriority ) {
|
||||
assert(0);
|
||||
HIP_RETURN(hipSuccess);
|
||||
}
|
||||
|
||||
hipError_t hipDeviceReset ( void ) {
|
||||
HIP_INIT_API();
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ hipDeviceGet
|
||||
hipDeviceGetAttribute
|
||||
hipDeviceGetByPCIBusId
|
||||
hipDeviceGetCacheConfig
|
||||
hipDeviceGetStreamPriorityRange
|
||||
hipDeviceGetLimit
|
||||
hipDeviceGetName
|
||||
hipDeviceGetPCIBusId
|
||||
@@ -123,6 +124,7 @@ hipSetDeviceFlags
|
||||
hipStreamAddCallback
|
||||
hipStreamCreate
|
||||
hipStreamCreateWithFlags
|
||||
hipStreamCreateWithPriority
|
||||
hipStreamDestroy
|
||||
hipStreamGetFlags
|
||||
hipStreamQuery
|
||||
|
||||
@@ -25,6 +25,7 @@ global:
|
||||
hipDeviceGetAttribute;
|
||||
hipDeviceGetByPCIBusId;
|
||||
hipDeviceGetCacheConfig;
|
||||
hipDeviceGetStreamPriorityRange;
|
||||
hipDeviceGetLimit;
|
||||
hipDeviceGetName;
|
||||
hipDeviceGetPCIBusId;
|
||||
@@ -123,6 +124,7 @@ global:
|
||||
hipStreamAddCallback;
|
||||
hipStreamCreate;
|
||||
hipStreamCreateWithFlags;
|
||||
hipStreamCreateWithPriority;
|
||||
hipStreamDestroy;
|
||||
hipStreamGetFlags;
|
||||
hipStreamQuery;
|
||||
|
||||
@@ -63,13 +63,13 @@ void CL_CALLBACK ihipStreamCallback(cl_event event, cl_int command_exec_status,
|
||||
delete cbo;
|
||||
}
|
||||
|
||||
static hipError_t ihipStreamCreateWithFlags(hipStream_t *stream, unsigned int flags) {
|
||||
static hipError_t ihipStreamCreate(hipStream_t *stream, unsigned int flags, amd::CommandQueue::Priority priority) {
|
||||
amd::Device* device = hip::getCurrentContext()->devices()[0];
|
||||
|
||||
cl_command_queue_properties properties = CL_QUEUE_PROFILING_ENABLE;
|
||||
amd::HostQueue* queue = new amd::HostQueue(*hip::getCurrentContext(), *device, properties,
|
||||
amd::CommandQueue::RealTimeDisabled,
|
||||
amd::CommandQueue::Priority::Normal);
|
||||
priority);
|
||||
|
||||
if (queue == nullptr || !queue->create()) {
|
||||
return hipErrorOutOfMemory;
|
||||
@@ -92,13 +92,38 @@ static hipError_t ihipStreamCreateWithFlags(hipStream_t *stream, unsigned int fl
|
||||
hipError_t hipStreamCreateWithFlags(hipStream_t *stream, unsigned int flags) {
|
||||
HIP_INIT_API(stream, flags);
|
||||
|
||||
HIP_RETURN(ihipStreamCreateWithFlags(stream, flags));
|
||||
HIP_RETURN(ihipStreamCreate(stream, flags, amd::CommandQueue::Priority::Normal));
|
||||
}
|
||||
|
||||
hipError_t hipStreamCreate(hipStream_t *stream) {
|
||||
HIP_INIT_API(stream);
|
||||
|
||||
HIP_RETURN(ihipStreamCreateWithFlags(stream, hipStreamDefault));
|
||||
HIP_RETURN(ihipStreamCreate(stream, hipStreamDefault, amd::CommandQueue::Priority::Normal));
|
||||
}
|
||||
|
||||
hipError_t hipStreamCreateWithPriority(hipStream_t* stream, unsigned int flags, int priority) {
|
||||
HIP_INIT_API(stream, flags, priority);
|
||||
|
||||
if (priority > static_cast<int>(amd::CommandQueue::Priority::High)) {
|
||||
priority = static_cast<int>(amd::CommandQueue::Priority::High);
|
||||
} else if (priority < static_cast<int>(amd::CommandQueue::Priority::Normal)) {
|
||||
priority = static_cast<int>(amd::CommandQueue::Priority::Normal);
|
||||
}
|
||||
|
||||
return HIP_RETURN(ihipStreamCreate(stream, flags, static_cast<amd::CommandQueue::Priority>(priority)));
|
||||
}
|
||||
|
||||
hipError_t hipDeviceGetStreamPriorityRange(int* leastPriority, int* greatestPriority) {
|
||||
HIP_INIT_API(leastPriority, greatestPriority);
|
||||
|
||||
if (leastPriority != nullptr) {
|
||||
*leastPriority = static_cast<int>(amd::CommandQueue::Priority::Normal);
|
||||
}
|
||||
if (greatestPriority != nullptr) {
|
||||
// Only report one kind of priority for now.
|
||||
*greatestPriority = static_cast<int>(amd::CommandQueue::Priority::Normal);
|
||||
}
|
||||
return HIP_RETURN(hipSuccess);
|
||||
}
|
||||
|
||||
hipError_t hipStreamGetFlags(hipStream_t stream, unsigned int *flags) {
|
||||
|
||||
مرجع در شماره جدید
Block a user