From 4e0baa79b3f088369f5bd77e487b8efe6ef40dcf Mon Sep 17 00:00:00 2001
From: foreman
Date: Tue, 21 Nov 2017 18:58:23 -0500
Subject: [PATCH] P4 to Git Change 1485337 by todli@todli-win-opencl-kv1 on
2017/11/21 18:53:38
SWDEV-126904 - Fix conformance Pipe read/write tests failures for ROCm/LC path and PAL/LC path
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palkernel.cpp#40 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rockernel.cpp#32 edit
---
rocclr/runtime/device/pal/palkernel.cpp | 9 ++++++++-
rocclr/runtime/device/rocm/rockernel.cpp | 9 ++++++++-
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/rocclr/runtime/device/pal/palkernel.cpp b/rocclr/runtime/device/pal/palkernel.cpp
index 5efc0a0192..3fbb6c0b9b 100644
--- a/rocclr/runtime/device/pal/palkernel.cpp
+++ b/rocclr/runtime/device/pal/palkernel.cpp
@@ -1291,6 +1291,7 @@ static inline HSAIL_ARG_TYPE GetKernelArgType(const KernelArgMD& lcArg) {
switch (lcArg.mValueKind) {
case ValueKind::GlobalBuffer:
case ValueKind::DynamicSharedPointer:
+ case ValueKind::Pipe:
return HSAIL_ARGTYPE_POINTER;
case ValueKind::ByValue:
return HSAIL_ARGTYPE_VALUE;
@@ -1358,7 +1359,9 @@ static inline HSAIL_ADDRESS_QUALIFIER GetKernelAddrQual(const KernelArgMD& lcArg
}
LogError("Unsupported address type");
return HSAIL_ADDRESS_ERROR;
- } else if (lcArg.mValueKind == ValueKind::Image || lcArg.mValueKind == ValueKind::Sampler) {
+ } else if (lcArg.mValueKind == ValueKind::Image ||
+ lcArg.mValueKind == ValueKind::Sampler ||
+ lcArg.mValueKind == ValueKind::Pipe) {
return HSAIL_ADDRESS_GLOBAL;
}
return HSAIL_ADDRESS_ERROR;
@@ -1413,6 +1416,10 @@ static inline cl_kernel_arg_type_qualifier GetOclTypeQual(const KernelArgMD& lcA
rv |= CL_KERNEL_ARG_TYPE_CONST;
}
}
+ else if (lcArg.mIsPipe) {
+ assert(lcArg.mValueKind == ValueKind::Pipe);
+ rv |= CL_KERNEL_ARG_TYPE_PIPE;
+ }
return rv;
}
diff --git a/rocclr/runtime/device/rocm/rockernel.cpp b/rocclr/runtime/device/rocm/rockernel.cpp
index 085379c188..01aa905f6f 100644
--- a/rocclr/runtime/device/rocm/rockernel.cpp
+++ b/rocclr/runtime/device/rocm/rockernel.cpp
@@ -22,6 +22,7 @@ static inline ROC_ARG_TYPE GetKernelArgType(const KernelArgMD& lcArg) {
switch (lcArg.mValueKind) {
case ValueKind::GlobalBuffer:
case ValueKind::DynamicSharedPointer:
+ case ValueKind::Pipe:
return ROC_ARGTYPE_POINTER;
case ValueKind::ByValue:
return ROC_ARGTYPE_VALUE;
@@ -193,7 +194,9 @@ static inline ROC_ADDRESS_QUALIFIER GetKernelAddrQual(const KernelArgMD& lcArg)
}
LogError("Unsupported address type");
return ROC_ADDRESS_ERROR;
- } else if (lcArg.mValueKind == ValueKind::Image || lcArg.mValueKind == ValueKind::Sampler) {
+ } else if (lcArg.mValueKind == ValueKind::Image ||
+ lcArg.mValueKind == ValueKind::Sampler ||
+ lcArg.mValueKind == ValueKind::Pipe) {
return ROC_ADDRESS_GLOBAL;
}
return ROC_ADDRESS_ERROR;
@@ -469,6 +472,10 @@ static inline cl_kernel_arg_type_qualifier GetOclTypeQual(const KernelArgMD& lcA
rv |= CL_KERNEL_ARG_TYPE_CONST;
}
}
+ else if (lcArg.mIsPipe) {
+ assert(lcArg.mValueKind == ValueKind::Pipe);
+ rv |= CL_KERNEL_ARG_TYPE_PIPE;
+ }
return rv;
}
#endif // defined(WITH_LIGHTNING_COMPILER)