Files
rocm-systems/rocclr/runtime/device/appprofile.hpp
T
foreman 16f8ca9aae P4 to Git Change 1079952 by yaxunl@yaxunl_stg_win50 on 2014/09/23 12:31:16
ECR #377625 - Workaround for Blender performance issue. Lower available VGPRs to improve waves per CU.

	Added BuildOptsAppend to OCL app profile.
	Read BuildOptsAppend and append to build options.
	Added specific wave optimization option for Blender.

Affected files ...

... //depot/stg/opencl/drivers/opencl/appprofiles/oclappprofile.xml#7 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/gpu/scwrapper/SI/scCompileSI.cpp#45 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/OPTIONS.def#116 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/appprofile.cpp#10 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/appprofile.hpp#8 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/device.cpp#170 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/device.hpp#230 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuappprofile.cpp#10 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuappprofile.hpp#6 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/program.cpp#63 edit
2014-09-23 12:44:50 -04:00

93 γραμμές
3.2 KiB
C++

//
// Copyright (c) 2014 Advanced Micro Devices, Inc. All rights reserved.
//
#ifndef APPPROFILE_HPP_
#define APPPROFILE_HPP_
#include "adl.h"
#include <map>
#include <string>
namespace amd {
class ADL {
public:
ADL();
~ADL();
bool init();
void* adlHandle() const { return adlHandle_; };
ADL_CONTEXT_HANDLE adlContext() const { return adlContext_; }
typedef int (*Adl2MainControlCreate)(ADL_MAIN_MALLOC_CALLBACK callback,
int iEnumConnectedAdapters,
ADL_CONTEXT_HANDLE* context);
typedef int (*Adl2MainControlDestroy)(ADL_CONTEXT_HANDLE context);
typedef int (*Adl2ConsoleModeFileDescriptorSet)(ADL_CONTEXT_HANDLE context, int fileDescriptor);
typedef int (*Adl2MainControlRefresh)(ADL_CONTEXT_HANDLE context);
typedef int (*Adl2ApplicationProfilesSystemReload)(ADL_CONTEXT_HANDLE context);
typedef int (*Adl2ApplicationProfilesProfileOfApplicationx2Search)(ADL_CONTEXT_HANDLE context,
const wchar_t* fileName,
const wchar_t* path,
const wchar_t* version,
const wchar_t* appProfileArea,
ADLApplicationProfile** lppProfile);
Adl2MainControlCreate adl2MainControlCreate;
Adl2MainControlDestroy adl2MainControlDestroy;
Adl2ConsoleModeFileDescriptorSet adl2ConsoleModeFileDescriptorSet;
Adl2MainControlRefresh adl2MainControlRefresh;
Adl2ApplicationProfilesSystemReload adl2ApplicationProfilesSystemReload;
Adl2ApplicationProfilesProfileOfApplicationx2Search adl2ApplicationProfilesProfileOfApplicationx2Search;
private:
void* adlHandle_;
ADL_CONTEXT_HANDLE adlContext_;
};
class AppProfile {
public:
AppProfile();
virtual ~AppProfile();
bool init();
cl_device_type ApplyHsaDeviceHintFlag(const cl_device_type& type);
bool IsHsaInitDisabled() { return noHsaInit_; }
const std::string& GetBuildOptsAppend() const { return buildOptsAppend_; }
protected:
enum DataTypes
{
DataType_Unknown = 0,
DataType_Boolean,
DataType_String,
};
struct PropertyData {
PropertyData(DataTypes type, void* data): type_(type), data_(data) {}
DataTypes type_; //!< Data type
void* data_; //!< Pointer to the data
};
typedef std::map<std::string, PropertyData> DataMap;
DataMap propertyDataMap_;
std::string appFileName_; // without extension
std::wstring wsAppFileName_;
virtual bool ParseApplicationProfile();
cl_device_type hsaDeviceHint_; // valid values: CL_HSA_ENABLED_AMD
// or CL_HSA_DISABLED_AMD
bool gpuvmHighAddr_; // Currently not used.
bool noHsaInit_; // Do not even initialize HSA.
bool profileOverridesAllSettings_; // Overrides hint flags and env.var.
std::string buildOptsAppend_;
};
}
#endif