Rename device access functions
Rename functions that access devices to reflect the derived device they return. This includes the base device::Device and the derived gpu/pal/roc device classes in both NullDevice and Device forms. Change to use the least derived versions to clarify what operations will be available. Change-Id: I1abb6bfed7efa24852bc8d0d49acaea357d8b5d0
This commit is contained in:
@@ -127,7 +127,7 @@ bool Program::initClBinary(char* binaryIn, size_t size) {
|
||||
|
||||
bool Program::defineGlobalVar(const char* name, void* dptr) {
|
||||
hsa_status_t status = HSA_STATUS_SUCCESS;
|
||||
hsa_agent_t hsa_device = dev().getBackendDevice();
|
||||
hsa_agent_t hsa_device = rocDevice().getBackendDevice();
|
||||
|
||||
status = hsa_executable_agent_global_variable_define(hsaExecutable_, hsa_device, name, dptr);
|
||||
if (status != HSA_STATUS_SUCCESS) {
|
||||
@@ -153,7 +153,7 @@ bool Program::createGlobalVarObj(amd::Memory** amd_mem_obj, void** device_pptr,
|
||||
return false;
|
||||
}
|
||||
|
||||
hsa_device= dev().getBackendDevice();
|
||||
hsa_device = rocDevice().getBackendDevice();
|
||||
|
||||
/* Find HSA Symbol by name */
|
||||
status = hsa_executable_get_symbol_by_name(hsaExecutable_, global_name, &hsa_device,
|
||||
@@ -206,7 +206,7 @@ bool Program::createGlobalVarObj(amd::Memory** amd_mem_obj, void** device_pptr,
|
||||
return false;
|
||||
}
|
||||
|
||||
roc_device = static_cast<const roc::Device*>(&dev());
|
||||
roc_device = &(rocDevice());
|
||||
*amd_mem_obj = new(roc_device->context()) amd::Buffer(roc_device->context(), 0, *bytes,
|
||||
*device_pptr);
|
||||
|
||||
@@ -227,7 +227,7 @@ bool Program::createGlobalVarObj(amd::Memory** amd_mem_obj, void** device_pptr,
|
||||
}
|
||||
|
||||
HSAILProgram::HSAILProgram(roc::NullDevice& device, amd::Program& owner) : roc::Program(device, owner) {
|
||||
machineTarget_ = dev().deviceInfo().machineTarget_;
|
||||
machineTarget_ = rocNullDevice().deviceInfo().machineTarget_;
|
||||
}
|
||||
|
||||
HSAILProgram::~HSAILProgram() {
|
||||
@@ -268,7 +268,7 @@ bool HSAILProgram::setKernels(amd::option::Options* options, void* binary, size_
|
||||
#if defined(WITH_COMPILER_LIB)
|
||||
// Stop compilation if it is an offline device - HSA runtime does not
|
||||
// support ISA compiled offline
|
||||
if (!dev().isOnline()) {
|
||||
if (!device().isOnline()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -294,7 +294,7 @@ bool HSAILProgram::setKernels(amd::option::Options* options, void* binary, size_
|
||||
return false;
|
||||
}
|
||||
|
||||
hsa_agent_t hsaDevice = dev().getBackendDevice();
|
||||
hsa_agent_t hsaDevice = rocDevice().getBackendDevice();
|
||||
status = hsa_executable_load_agent_code_object(hsaExecutable_, hsaDevice, hsaCodeObjectReader_,
|
||||
nullptr, nullptr);
|
||||
if (status != HSA_STATUS_SUCCESS) {
|
||||
@@ -432,7 +432,7 @@ LightningProgram::LightningProgram(roc::NullDevice& device, amd::Program& owner)
|
||||
: roc::Program(device, owner) {
|
||||
isLC_ = true;
|
||||
isHIP_ = (owner.language() == amd::Program::HIP);
|
||||
machineTarget_ = dev().deviceInfo().machineTargetLC_;
|
||||
machineTarget_ = rocNullDevice().deviceInfo().machineTargetLC_;
|
||||
}
|
||||
|
||||
bool LightningProgram::createBinary(amd::option::Options* options) {
|
||||
@@ -477,7 +477,7 @@ bool LightningProgram::setKernels(amd::option::Options* options, void* binary, s
|
||||
return false;
|
||||
}
|
||||
|
||||
hsa_agent_t agent = dev().getBackendDevice();
|
||||
hsa_agent_t agent = rocDevice().getBackendDevice();
|
||||
hsa_status_t status;
|
||||
|
||||
status = hsa_executable_create_alt(HSA_PROFILE_FULL, HSA_DEFAULT_FLOAT_ROUNDING_MODE_DEFAULT,
|
||||
|
||||
Reference in New Issue
Block a user