Files
clang-p2996/openmp/libomptarget/plugins/amdgpu/impl/data.cpp
Jon Chesterfield 3153bdd547 [libomptarget][amdgpu] Drop env variables
Use the same debug print as the rest of libomptarget plugins with
the same environment control. Also drop the max queue size debugging hook as
I don't believe it is still in use, can bring it back near the rest of the env
handling in rtl.cpp if someone objects.

That makes most of rt.h and all of utils.cpp unused. Clean that up and simplify
control flow in a couple of places.

Behaviour change is that debug prints that used to use the old environment
variable now use the new one and print in slightly different format, and the
removal of the max queue size variable.

Reviewed By: pdhaliwal

Differential Revision: https://reviews.llvm.org/D108784
2021-09-02 11:02:39 +01:00

38 lines
1.1 KiB
C++

//===--- amdgpu/impl/data.cpp ------------------------------------- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include "impl_runtime.h"
#include "hsa_api.h"
#include "internal.h"
#include "rt.h"
#include <cassert>
#include <stdio.h>
#include <string.h>
#include <vector>
using core::TaskImpl;
namespace core {
namespace Runtime {
hsa_status_t HostMalloc(void **ptr, size_t size,
hsa_amd_memory_pool_t MemoryPool) {
hsa_status_t err = hsa_amd_memory_pool_allocate(MemoryPool, size, 0, ptr);
DP("Malloced %p\n", *ptr);
if (err == HSA_STATUS_SUCCESS) {
err = core::allow_access_to_all_gpu_agents(*ptr);
}
return err;
}
hsa_status_t Memfree(void *ptr) {
hsa_status_t err = hsa_amd_memory_pool_free(ptr);
DP("Freed %p\n", ptr);
return err;
}
} // namespace Runtime
} // namespace core