From ef61d9be8c3f9bd138474beb1f53ea486669ca95 Mon Sep 17 00:00:00 2001
From: foreman
Date: Fri, 18 Jul 2014 05:53:53 -0400
Subject: [PATCH] P4 to Git Change 1056679 by
drai@drai_MSDNBGLDEEPALI_laurent_CS on 2014/07/18 05:37:39
ECR #333753 - Added new enum for argument type 'queue_t' and its support in compiler library and runtime
Device Enqueue : MDParser changes for argument type 'queue_t'
Reviewed by : Prakash, Brian, Evgeniy, German
Testing : smoke, smoke_clang, precheckin
Affected files ...
... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/gpu/metadata.cpp#5 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/include/v0_8/aclEnums.h#10 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/include/v0_8/aclStructs.h#11 edit
... //depot/stg/opencl/drivers/opencl/compiler/llvm/lib/Target/AMDIL/MDParser/AMDILMDInterface.h#55 edit
... //depot/stg/opencl/drivers/opencl/compiler/llvm/lib/Target/AMDIL/MDParser/AMDILMDParser.l#59 edit
... //depot/stg/opencl/drivers/opencl/compiler/llvm/lib/Target/AMDIL/MDParser/AMDILMDParser.output#22 edit
... //depot/stg/opencl/drivers/opencl/compiler/llvm/lib/Target/AMDIL/MDParser/AMDILMDParser.tab.cpp#36 edit
... //depot/stg/opencl/drivers/opencl/compiler/llvm/lib/Target/AMDIL/MDParser/AMDILMDParser.tab.hpp#28 edit
... //depot/stg/opencl/drivers/opencl/compiler/llvm/lib/Target/AMDIL/MDParser/AMDILMDParser.y#47 edit
... //depot/stg/opencl/drivers/opencl/compiler/llvm/lib/Target/AMDIL/MDParser/AMDILMDTypes.cpp#111 edit
... //depot/stg/opencl/drivers/opencl/compiler/llvm/lib/Target/AMDIL/MDParser/AMDILMDTypes.h#33 edit
... //depot/stg/opencl/drivers/opencl/compiler/llvm/lib/Target/AMDIL/MDParser/lex.yy.cpp#54 edit
... //depot/stg/opencl/drivers/opencl/compiler/llvm/lib/Target/AMDIL/MDParser/location.hh#20 edit
... //depot/stg/opencl/drivers/opencl/compiler/llvm/lib/Target/AMDIL/MDParser/position.hh#24 edit
... //depot/stg/opencl/drivers/opencl/compiler/llvm/lib/Target/AMDIL/MDParser/stack.hh#20 edit
... //depot/stg/opencl/drivers/opencl/compiler/llvm/lib/Target/HSAIL/HSAILKernelManager.cpp#19 edit
... //depot/stg/opencl/drivers/opencl/compiler/llvm/lib/Target/HSAIL/HSAILMetadata.hpp#4 edit
... //depot/stg/opencl/drivers/opencl/compiler/llvm/lib/Target/HSAIL/HSAILOpaqueTypes.cpp#6 edit
... //depot/stg/opencl/drivers/opencl/compiler/llvm/lib/Target/HSAIL/HSAILOpaqueTypes.h#6 edit
... //depot/stg/opencl/drivers/opencl/compiler/llvm/lib/Target/HSAIL/HSAILUtilityFunctions.cpp#26 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpukernel.cpp#258 edit
... //depot/stg/opencl/drivers/opencl/tests/ocltst/module/complib/CLEnumCheck.cpp#34 edit
[ROCm/clr commit: eb70ad5007e7187e7ad678a1e8f1b1084f19f537]
---
.../clr/rocclr/compiler/lib/include/v0_8/aclEnums.h | 3 ++-
.../rocclr/compiler/lib/include/v0_8/aclStructs.h | 7 +++++++
projects/clr/rocclr/runtime/device/gpu/gpukernel.cpp | 12 +++++++-----
3 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/projects/clr/rocclr/compiler/lib/include/v0_8/aclEnums.h b/projects/clr/rocclr/compiler/lib/include/v0_8/aclEnums.h
index 1f6432b6e7..e9f11f6dfb 100644
--- a/projects/clr/rocclr/compiler/lib/include/v0_8/aclEnums.h
+++ b/projects/clr/rocclr/compiler/lib/include/v0_8/aclEnums.h
@@ -258,7 +258,8 @@ typedef enum _acl_arg_type_enum_0_8 {
ARG_TYPE_VALUE = 4,
ARG_TYPE_POINTER = 5,
ARG_TYPE_SEMAPHORE = 6,
- ARG_TYPE_LAST = 7
+ ARG_TYPE_QUEUE = 7, // enum for device enqueue
+ ARG_TYPE_LAST = 8
} aclArgType_0_8;
// Enumerations of the valid data types for pass by value and
diff --git a/projects/clr/rocclr/compiler/lib/include/v0_8/aclStructs.h b/projects/clr/rocclr/compiler/lib/include/v0_8/aclStructs.h
index 6fdcc792bf..eee00b1e86 100644
--- a/projects/clr/rocclr/compiler/lib/include/v0_8/aclStructs.h
+++ b/projects/clr/rocclr/compiler/lib/include/v0_8/aclStructs.h
@@ -66,6 +66,13 @@ typedef struct _acl_md_arg_type_0_8 {
bool isRestrict;
bool isPipe;
} pointer;
+ struct { // Struct for queue arguments
+ unsigned numElements;
+ unsigned cbNum;
+ unsigned cbOffset;
+ aclArgDataType data;
+ aclMemoryType memory;
+ } queue;
} arg;
aclArgType type;
bool isConst;
diff --git a/projects/clr/rocclr/runtime/device/gpu/gpukernel.cpp b/projects/clr/rocclr/runtime/device/gpu/gpukernel.cpp
index 780d458ba9..e477080fcc 100644
--- a/projects/clr/rocclr/runtime/device/gpu/gpukernel.cpp
+++ b/projects/clr/rocclr/runtime/device/gpu/gpukernel.cpp
@@ -3055,10 +3055,9 @@ GetHSAILArgType(const aclArgData* argInfo)
{
switch (argInfo->type) {
case ARG_TYPE_POINTER:
- if (argInfo->arg.pointer.memory == PTR_MT_SCRATCH_EMU) {
- return HSAIL_ARGTYPE_QUEUE;
- }
return HSAIL_ARGTYPE_POINTER;
+ case ARG_TYPE_QUEUE:
+ return HSAIL_ARGTYPE_QUEUE;
case ARG_TYPE_VALUE:
return HSAIL_ARGTYPE_VALUE;
case ARG_TYPE_IMAGE:
@@ -3107,6 +3106,9 @@ GetHSAILAddrQual(const aclArgData* argInfo)
(argInfo->type == ARG_TYPE_SAMPLER)) {
return HSAIL_ADDRESS_GLOBAL;
}
+ else if (argInfo->type == ARG_TYPE_QUEUE) {
+ return HSAIL_ADDRESS_GLOBAL;
+ }
return HSAIL_ADDRESS_ERROR;
}
@@ -3195,6 +3197,7 @@ GetHSAILArgSize(const aclArgData *argInfo)
case ARG_TYPE_POINTER:
case ARG_TYPE_IMAGE:
case ARG_TYPE_SAMPLER:
+ case ARG_TYPE_QUEUE:
return sizeof(void*);
default:
return -1;
@@ -3214,8 +3217,7 @@ GetOclType(const aclArgData* argInfo)
};
uint sizeType;
- if ((argInfo->type == ARG_TYPE_POINTER) &&
- (argInfo->arg.pointer.memory == PTR_MT_SCRATCH_EMU)) {
+ if (argInfo->type == ARG_TYPE_QUEUE) {
return T_QUEUE;
}
if ((argInfo->type == ARG_TYPE_POINTER) || (argInfo->type == ARG_TYPE_IMAGE)) {