P4 to Git Change 1077336 by emankov@em-hsa-amd on 2014/09/16 11:13:20
ECR #333753 - Compiler Lib/RT: Fix RT_DEVICE_ENQUEUE & RT_KERNEL_INDEX querying
tests: pre check-in, compiler ocl conformance tests
Reviewer: German Andryeyev, Vinay Madhusudan
Affected files ...
... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/common/v0_8/if_acl.cpp#48 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpukernel.cpp#263 edit
[ROCm/clr commit: 09fb6c961b]
Šī revīzija ir iekļauta:
@@ -2457,10 +2457,10 @@ if_aclQueryInfo(aclCompiler *cl,
|
||||
}
|
||||
case RT_DEVICE_ENQUEUE: {
|
||||
if (size != NULL && ptr == NULL) {
|
||||
(*size) = sizeof(uint32_t);
|
||||
} else if (ptr != NULL && (*size) >= (sizeof(uint32_t))) {
|
||||
(*size) = sizeof(aclMetadata().enqueue_kernel);
|
||||
} else if (ptr != NULL && (*size) >= (sizeof(aclMetadata().enqueue_kernel))) {
|
||||
const aclMetadata *md = reinterpret_cast<const aclMetadata*>(roSec);
|
||||
(*reinterpret_cast<uint32_t*>(ptr)) = md->enqueue_kernel;
|
||||
memcpy(ptr, &md->enqueue_kernel, sizeof(md->enqueue_kernel));
|
||||
} else {
|
||||
success = false;
|
||||
}
|
||||
@@ -2469,10 +2469,10 @@ if_aclQueryInfo(aclCompiler *cl,
|
||||
// Temporary approach till the "ldk" instruction is supported.
|
||||
case RT_KERNEL_INDEX: {
|
||||
if (size != NULL && ptr == NULL) {
|
||||
(*size) = sizeof(uint32_t);
|
||||
} else if (ptr != NULL && (*size) >= (sizeof(uint32_t))) {
|
||||
(*size) = sizeof(aclMetadata().kernel_index);
|
||||
} else if (ptr != NULL && (*size) >= (sizeof(aclMetadata().kernel_index))) {
|
||||
const aclMetadata *md = reinterpret_cast<const aclMetadata*>(roSec);
|
||||
(*reinterpret_cast<uint32_t*>(ptr)) = md->kernel_index;
|
||||
memcpy(ptr, &md->kernel_index, sizeof(md->kernel_index));
|
||||
} else {
|
||||
success = false;
|
||||
}
|
||||
|
||||
@@ -3612,20 +3612,21 @@ HSAILKernel::init()
|
||||
delete [] aclPrintfList;
|
||||
}
|
||||
|
||||
size_t sizeOfDevice;
|
||||
bool hasKernelEnqueue = false;
|
||||
size_t sizeOfDeviceEnqueue = sizeof(hasKernelEnqueue);
|
||||
error = aclQueryInfo(dev().hsaCompiler(), prog().binaryElf(),
|
||||
RT_DEVICE_ENQUEUE, openClKernelName.c_str(),
|
||||
&hasKernelEnqueue, &sizeOfDevice);
|
||||
&hasKernelEnqueue, &sizeOfDeviceEnqueue);
|
||||
if (error != ACL_SUCCESS) {
|
||||
return false;
|
||||
}
|
||||
flags_.dynamicParallelism_ = hasKernelEnqueue;
|
||||
|
||||
int index = -1;
|
||||
size_t sizeOfIndex = sizeof(index);
|
||||
error = aclQueryInfo(dev().hsaCompiler(), prog().binaryElf(),
|
||||
RT_KERNEL_INDEX, openClKernelName.c_str(),
|
||||
&index, &sizeOfDevice);
|
||||
&index, &sizeOfIndex);
|
||||
if (error != ACL_SUCCESS) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Atsaukties uz šo jaunā problēmā
Block a user