773ffef7d2
ECR #354633 - SPIR-V: Add consumption of SPIR-V to HSAIL path. Affected files ... ... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/build/Makefile.api#120 edit ... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_program.cpp#36 edit ... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/icd/OpenCL.def.in#11 edit ... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/icd/icd_exports.map.in#7 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/Makefile#35 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/api/v0_8/acl.cpp#34 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/api/v0_8/aclValidation.cpp#6 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/common/v0_8/if_acl.cpp#73 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/build/Makefile.complib#90 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/include/v0_8/acl.h#10 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/include/v0_8/aclEnums.h#21 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/include/v0_8/aclTypes.h#7 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/loaders/bif/bifinternal.hpp#11 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/spirv/Makefile#1 add ... //depot/stg/opencl/drivers/opencl/compiler/lib/spirv/build/Makefile#1 add ... //depot/stg/opencl/drivers/opencl/compiler/lib/spirv/build/Makefile.spirv#1 add ... //depot/stg/opencl/drivers/opencl/compiler/lib/spirv/spirvUtils.cpp#1 add ... //depot/stg/opencl/drivers/opencl/compiler/lib/spirv/spirvUtils.h#1 add ... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/options.hpp#16 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/v0_8/libUtils.h#22 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/device.cpp#182 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/device.hpp#250 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuprogram.cpp#200 edit ... //depot/stg/opencl/drivers/opencl/runtime/platform/program.cpp#64 edit ... //depot/stg/opencl/drivers/opencl/tests/conformance/devel/2.0/test_conformance/spirv/select.zip#1 add ... //depot/stg/opencl/drivers/opencl/tests/ocltst/module/complib/CLEnumCheck.cpp#46 edit ... //depot/stg/opencl/drivers/opencl/tests/ocltst/module/complib/CLEnumCheck.h#4 edit ... //depot/stg/opencl/drivers/opencl/tests/ocltst/module/complib/aclAPI.cpp#20 edit
19 строки
450 B
C++
19 строки
450 B
C++
#include "spirvUtils.h"
|
|
|
|
const unsigned SPRVMagicNumber = 0x07230203;
|
|
|
|
bool isSPIRVMagic(const void* Image, size_t Length) {
|
|
if (Image == nullptr || Length < sizeof(unsigned))
|
|
return false;
|
|
auto Magic = static_cast<const unsigned*>(Image);
|
|
return *Magic == SPRVMagicNumber;
|
|
}
|
|
|
|
// ToDo: replace this with SPIR-V validator when it is available.
|
|
bool
|
|
validateSPIRV(const void *Image, size_t Length) {
|
|
return isSPIRVMagic(Image, Length);
|
|
}
|
|
|
|
|