Files
rocm-systems/rocclr/runtime/device/hsa/hsasettings.cpp
T
foreman b6c34a714c P4 to Git Change 1191432 by yaxunl@yaxunl_stg_win50 on 2015/09/16 17:16:06
ECR #354633 - SPIR-V: Rename clCreateProgramWithIL as clCreateProgramWithILKHR and define it as an extension API.
	Add API to OCL 1.2/2.1.
	Add cl_khr_il_program extension.
	Fix SPIR-V conformance and ocltst.

Affected files ...

... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/amdocl.def.in#15 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/amdocl.map.in#18 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_context.cpp#44 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_icd.cpp#24 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_icd_amd.h#17 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_program.cpp#37 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl_ext.h#9 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl.h#21 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_ext.h#16 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.1/CL/cl.h#3 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/icd/OpenCL.def.in#12 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/icd/icd_dispatch.c#28 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/icd/icd_dispatch.h#23 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/icd/icd_exports.map.in#8 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/cpu/cpusettings.cpp#30 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/device.hpp#252 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/hsa/hsasettings.cpp#37 edit
... //depot/stg/opencl/drivers/opencl/tests/conformance/devel/2.0/test_conformance/spirv/main.cpp#7 edit
... //depot/stg/opencl/drivers/opencl/tests/conformance/devel/2.0/test_conformance/spirv/run_services.cpp#3 edit
... //depot/stg/opencl/drivers/opencl/tests/ocltst/module/spir/SPIRVBasic.cpp#3 edit
2015-09-16 17:29:07 -04:00

82 lines
2.0 KiB
C++

//
// Copyright (c) 2010 Advanced Micro Devices, Inc. All rights reserved.
//
#ifndef WITHOUT_GPU_BACKEND
#include "top.hpp"
#include "os/os.hpp"
#include "device/device.hpp"
#include "hsasettings.hpp"
namespace oclhsa {
Settings::Settings()
{
// Initialize the HSA device default settings
// Set this to true when we drop the flag
doublePrecision_ = ::CL_KHR_FP64;
pollCompletion_ = ENVVAR_HSA_POLL_KERNEL_COMPLETION;
// Enable "local" memory in HSA
enableLocalMemory_ = HSA_LOCAL_MEMORY_ENABLE;
enableSvm32BitsAtomics_ = HSA_ENABLE_ATOMICS_32B;
maxWorkGroupSize_ = 256;
maxWorkGroupSize2DX_ = 16;
maxWorkGroupSize2DY_ = 16;
maxWorkGroupSize3DX_ = 4;
maxWorkGroupSize3DY_ = 4;
maxWorkGroupSize3DZ_ = 4;
}
bool
Settings::create(bool doublePrecision)
{
largeHostMemAlloc_ = true;
customHostAllocator_ = true;
// Enable extensions
enableExtension(ClKhrByteAddressableStore);
enableExtension(ClKhrGlobalInt32BaseAtomics);
enableExtension(ClKhrGlobalInt32ExtendedAtomics);
enableExtension(ClKhrLocalInt32BaseAtomics);
enableExtension(ClKhrLocalInt32ExtendedAtomics);
enableExtension(ClExtAtomicCounters32);
//enableExtension(ClKhr3DImageWrites);
enableExtension(ClKhrGlSharing);
enableExtension(ClAmdMediaOps);
enableExtension(ClAmdMediaOps2);
#if defined(_WIN32)
enableExtension(ClKhrD3d10Sharing);
enableExtension(ClKhrD3d11Sharing);
#endif // _WIN32
//enableExtension(ClKhrImage2dFromBuffer);
//enableExtension(ClAmdImage2dFromBufferReadOnly);
// Make sure device supports doubles
doublePrecision_ &= doublePrecision;
if (doublePrecision_) {
// Enable KHR double precision extension
enableExtension(ClKhrFp64);
// Also enable AMD double precision extension?
enableExtension(ClAmdFp64);
}
enableExtension(ClKhrIlProgram);
// Override current device settings
override();
return true;
}
void
Settings::override()
{
}
} // namespace oclhsa
#endif // WITHOUT_GPU_BACKEND