Files
rocm-systems/rocclr/runtime/device/rocm/rocappprofile.cpp
T
foreman 5ba83829e2 P4 to Git Change 1294024 by lmoriche@lmoriche_opencl_dev on 2016/07/21 12:33:32
SWDEV-94640 - Re-submit CL#1292110 after integration from fsa_foundation:
	      - [OCL-LC-ROCm] OpenCL Runtime Library Implements OpenCL runtime API. Add HSA virtual device to ORCA.
	        Rename hsa_foundation to ROCm

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/Makefile#3 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/build/Makefile#3 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/build/Makefile.rocm#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/mesa_glinterop.h#3 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocappprofile.cpp#3 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocappprofile.hpp#3 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocbinary.cpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocbinary.hpp#3 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocblit.cpp#3 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocblit.hpp#3 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/roccompiler.cpp#3 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/roccompilerlib.cpp#3 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/roccompilerlib.hpp#3 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdefs.hpp#4 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.cpp#4 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.hpp#3 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocglinterop.cpp#3 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocglinterop.hpp#3 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rockernel.cpp#3 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rockernel.hpp#3 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/roclib.cpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/roclib.h#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocmemory.cpp#3 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocmemory.hpp#3 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocprintf.cpp#3 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocprintf.hpp#3 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocprogram.cpp#3 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocprogram.hpp#3 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocregisters.hpp#3 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocsettings.cpp#3 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocsettings.hpp#3 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocvirtual.cpp#3 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocvirtual.hpp#3 add
2016-07-21 12:41:26 -04:00

62 строки
1.5 KiB
C++

//
// Copyright (c) 2009 Advanced Micro Devices, Inc. All rights reserved.
//
#ifndef WITHOUT_HSA_BACKEND
#include "top.hpp"
#include "device/device.hpp"
#include "device/appprofile.hpp"
#include "device/rocm/rocappprofile.hpp"
#include <algorithm>
amd::AppProfile* rocCreateAppProfile()
{
amd::AppProfile* appProfile = new roc::AppProfile;
if ((appProfile == NULL) || !appProfile->init()) {
return NULL;
}
return appProfile;
}
namespace roc {
bool AppProfile::ParseApplicationProfile()
{
std::string appName("Explorer");
std::transform(appName.begin(), appName.end(), appName.begin(), ::tolower);
std::transform(appFileName_.begin(), appFileName_.end(), appFileName_.begin(), ::tolower);
if (appFileName_.compare(appName) == 0 ) {
hsaDeviceHint_ = CL_HSA_DISABLED_AMD;
gpuvmHighAddr_ = false;
noHsaInit_ = true;
profileOverridesAllSettings_ = true;
}
// Setting both bits is invalid, make it niether.
if (hsaDeviceHint_ & CL_HSA_ENABLED_AMD
&& hsaDeviceHint_ & CL_HSA_DISABLED_AMD) {
hsaDeviceHint_ = 0;
}
if (noHsaInit_) {
// If no HSA initialization, then force hint flag to non-HSA device.
// Even if this is not forced, the device selection logic will endure it.
// After all hint flags are treated as hint only - depending on
// availibility.
hsaDeviceHint_ = CL_HSA_DISABLED_AMD;
}
return true;
}
}
#endif