Fichiers
rocm-systems/rocclr/runtime/device/hsa/hsasettings.cpp
T
foreman 37a837dc8f P4 to Git Change 1094476 by xcui@merged_opencl_jxcwin on 2014/11/06 14:39:20
EPR #406328 - removed the customSVMallocator from runtime, and also changed the name of customSvmAllocDevice to svmAllocDevice, because we don't use custom svm allocator for devices.
	precheckin testing:
	http://ocltc.amd.com:8111/viewModification.html?modId=43040&personal=true&buildTypeId=&tab=vcsModificationBuilds&show_all_builds=true
	code review:
	http://ocltc.amd.com/reviews/r/6222/

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/cpu/cpusettings.cpp#29 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/device.cpp#171 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/device.hpp#232 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpusettings.cpp#293 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/hsa/hsasettings.cpp#36 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/context.cpp#33 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/context.hpp#23 edit
2014-11-06 15:47:27 -05:00

81 lignes
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);
}
// Override current device settings
override();
return true;
}
void
Settings::override()
{
}
} // namespace oclhsa
#endif // WITHOUT_GPU_BACKEND