P4 to Git Change 1599194 by gandryey@gera-w8 on 2018/08/28 18:38:33
SWDEV-79445 - OCL generic changes and code clean-up
- Move printf setup in the kernels to the abstraction layer
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/devkernel.cpp#2 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/devkernel.hpp#2 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpukernel.cpp#329 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpukernel.hpp#131 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuprintf.cpp#47 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuprintf.hpp#16 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuprogram.cpp#238 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuprogram.hpp#71 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palkernel.cpp#62 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palkernel.hpp#21 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palprintf.cpp#10 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palprintf.hpp#4 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rockernel.cpp#41 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rockernel.hpp#25 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocprintf.cpp#11 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocprintf.hpp#6 edit
[ROCm/clr commit: ef83d84899]
This commit is contained in:
@@ -85,6 +85,12 @@ struct KernelParameterDescriptor {
|
||||
|
||||
namespace device {
|
||||
|
||||
//! Printf info structure
|
||||
struct PrintfInfo {
|
||||
std::string fmtString_; //!< formated string for printf
|
||||
std::vector<uint> arguments_; //!< passed arguments to the printf() call
|
||||
};
|
||||
|
||||
//! \class DeviceKernel, which will contain the common fields for any device
|
||||
class Kernel : public amd::HeapObject {
|
||||
public:
|
||||
@@ -228,21 +234,29 @@ class Kernel : public amd::HeapObject {
|
||||
//! Returns TRUE if it's a HSA kernel
|
||||
bool hsa() const { return (flags_.hsa_) ? true : false; }
|
||||
|
||||
//! Return printf info array
|
||||
const std::vector<PrintfInfo>& printfInfo() const { return printf_; }
|
||||
|
||||
protected:
|
||||
//! Initializes the abstraction layer kernel parameters
|
||||
#if defined(WITH_LIGHTNING_COMPILER)
|
||||
void InitParameters(const KernelMD& kernelMD, uint32_t argBufferSize);
|
||||
//! Initializes HSAIL Printf metadata and info for LC
|
||||
void InitPrintf(const std::vector<std::string>& printfInfoStrings);
|
||||
#endif
|
||||
#if defined(WITH_COMPILER_LIB) || !defined(WITH_LIGHTNING_COMPILER)
|
||||
void InitParameters(
|
||||
const aclArgData* aclArg, //!< List of ACL arguments
|
||||
uint32_t argBufferSize
|
||||
);
|
||||
//! Initializes HSAIL Printf metadata and info
|
||||
void InitPrintf(const aclPrintfFmt* aclPrintf);
|
||||
#endif
|
||||
std::string name_; //!< kernel name
|
||||
WorkGroupInfo workGroupInfo_; //!< device kernel info structure
|
||||
amd::KernelSignature* signature_; //!< kernel signature
|
||||
std::string buildLog_; //!< build log
|
||||
std::vector<PrintfInfo> printf_; //!< Format strings for GPU printf support
|
||||
|
||||
union Flags {
|
||||
struct {
|
||||
|
||||
Reference in New Issue
Block a user