2014-07-04 16:17:05 -04:00
|
|
|
//
|
|
|
|
|
// Copyright (c) 2014 Advanced Micro Devices, Inc. All rights reserved.
|
|
|
|
|
//
|
|
|
|
|
#ifndef APPPROFILE_HPP_
|
|
|
|
|
#define APPPROFILE_HPP_
|
|
|
|
|
|
2014-09-23 12:44:50 -04:00
|
|
|
#include <map>
|
2014-07-04 16:17:05 -04:00
|
|
|
#include <string>
|
|
|
|
|
|
|
|
|
|
namespace amd {
|
|
|
|
|
|
|
|
|
|
class AppProfile {
|
|
|
|
|
public:
|
|
|
|
|
AppProfile();
|
|
|
|
|
virtual ~AppProfile();
|
|
|
|
|
|
|
|
|
|
bool init();
|
|
|
|
|
|
|
|
|
|
cl_device_type ApplyHsaDeviceHintFlag(const cl_device_type& type);
|
|
|
|
|
bool IsHsaInitDisabled() { return noHsaInit_; }
|
2014-09-23 12:44:50 -04:00
|
|
|
const std::string& GetBuildOptsAppend() const { return buildOptsAppend_; }
|
2014-07-04 16:17:05 -04:00
|
|
|
protected:
|
2014-09-23 12:44:50 -04:00
|
|
|
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_;
|
2014-07-04 16:17:05 -04:00
|
|
|
std::string appFileName_; // without extension
|
|
|
|
|
std::wstring wsAppFileName_;
|
|
|
|
|
|
2014-09-23 12:44:50 -04:00
|
|
|
virtual bool ParseApplicationProfile();
|
2014-07-04 16:17:05 -04:00
|
|
|
|
|
|
|
|
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.
|
2014-09-23 12:44:50 -04:00
|
|
|
std::string buildOptsAppend_;
|
2014-07-04 16:17:05 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|