diff --git a/openmp/libomptarget/plugins/amdgpu/impl/atmi_interop_hsa.cpp b/openmp/libomptarget/plugins/amdgpu/impl/atmi_interop_hsa.cpp --- a/openmp/libomptarget/plugins/amdgpu/impl/atmi_interop_hsa.cpp +++ b/openmp/libomptarget/plugins/amdgpu/impl/atmi_interop_hsa.cpp @@ -6,8 +6,6 @@ #include "atmi_interop_hsa.h" #include "internal.h" -using core::atl_is_atmi_initialized; - atmi_status_t atmi_interop_hsa_get_symbol_info( const std::map &SymbolInfoTable, atmi_mem_place_t place, const char *symbol, void **var_addr, @@ -21,8 +19,6 @@ atmi_memcpy(signal, host_add, var_addr, var_size); */ - if (!atl_is_atmi_initialized()) - return ATMI_STATUS_ERROR; atmi_machine_t *machine = atmi_machine_get_info(); if (!symbol || !var_addr || !var_size || !machine) return ATMI_STATUS_ERROR; @@ -57,8 +53,6 @@ &val); */ - if (!atl_is_atmi_initialized()) - return ATMI_STATUS_ERROR; atmi_machine_t *machine = atmi_machine_get_info(); if (!kernel_name || !value || !machine) return ATMI_STATUS_ERROR; diff --git a/openmp/libomptarget/plugins/amdgpu/impl/system.cpp b/openmp/libomptarget/plugins/amdgpu/impl/system.cpp --- a/openmp/libomptarget/plugins/amdgpu/impl/system.cpp +++ b/openmp/libomptarget/plugins/amdgpu/impl/system.cpp @@ -146,8 +146,6 @@ std::vector atl_gpu_kernarg_pools; -bool g_atmi_initialized = false; - /* atlc is all internal global values. The structure atl_context_t is defined in atl_internal.h @@ -163,18 +161,6 @@ return &g_atmi_machine; } -static void atl_set_atmi_initialized() { - // FIXME: thread safe? locks? - g_atmi_initialized = true; -} - -static void atl_reset_atmi_initialized() { - // FIXME: thread safe? locks? - g_atmi_initialized = false; -} - -bool atl_is_atmi_initialized() { return g_atmi_initialized; } - hsa_status_t allow_access_to_all_gpu_agents(void *ptr) { std::vector &gpu_procs = g_atl_machine.processors(); @@ -186,26 +172,18 @@ } atmi_status_t Runtime::Initialize() { - atmi_devtype_t devtype = ATMI_DEVTYPE_GPU; - if (atl_is_atmi_initialized()) - return ATMI_STATUS_SUCCESS; - - if (devtype == ATMI_DEVTYPE_ALL || devtype & ATMI_DEVTYPE_GPU) { - atmi_status_t rc = atl_init_gpu_context(); - if (rc != ATMI_STATUS_SUCCESS) { - printf("[%s:%d] %s failed: %s\n", __FILE__, __LINE__, "GPU context init", - get_atmi_error_string(atl_init_gpu_context())); - return rc; - } + atmi_status_t rc = atl_init_gpu_context(); + if (rc != ATMI_STATUS_SUCCESS) { + printf("[%s:%d] %s failed: %s\n", __FILE__, __LINE__, "GPU context init", + get_atmi_error_string(atl_init_gpu_context())); + return rc; } - atl_set_atmi_initialized(); return ATMI_STATUS_SUCCESS; } atmi_status_t Runtime::Finalize() { atmi_status_t rc = ATMI_STATUS_SUCCESS; - atl_reset_atmi_initialized(); hsa_status_t err = hsa_shut_down(); if (err != HSA_STATUS_SUCCESS) { printf("[%s:%d] %s failed: %s\n", __FILE__, __LINE__, "Shutting down HSA",