[libomptarget][amdgpu][nfc] Refactor #includes

Create a hsa_api.h header that includes the ROCr headers in use
Drop some unused headers and _cplusplus macros

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D106455
This commit is contained in:
Jon Chesterfield 2021-07-21 17:28:07 +01:00
parent 1a57ee1276
commit a733bbbd17
10 changed files with 23 additions and 36 deletions

View File

@ -4,10 +4,9 @@
* This file is distributed under the MIT License. See LICENSE.txt for details.
*===------------------------------------------------------------------------*/
#include "atmi_runtime.h"
#include "hsa_api.h"
#include "internal.h"
#include "rt.h"
#include <hsa.h>
#include <hsa_ext_amd.h>
#include <memory>
/*

View File

@ -7,16 +7,14 @@
#define INCLUDE_ATMI_INTEROP_HSA_H_
#include "atmi_runtime.h"
#include "hsa.h"
#include "hsa_ext_amd.h"
#include "hsa_api.h"
#include "internal.h"
#include <map>
#include <string>
#ifdef __cplusplus
extern "C" {
#endif
/** \defgroup interop_hsa_functions ATMI-HSA Interop
* @{
*/
@ -80,8 +78,6 @@ hsa_status_t atmi_interop_hsa_get_kernel_info(
/** @} */
#ifdef __cplusplus
}
#endif
#endif // INCLUDE_ATMI_INTEROP_HSA_H_

View File

@ -7,16 +7,9 @@
#define INCLUDE_ATMI_RUNTIME_H_
#include "atmi.h"
#include "hsa.h"
#include <inttypes.h>
#include <stdlib.h>
#ifndef __cplusplus
#include <stdbool.h>
#endif
#include "hsa_api.h"
#ifdef __cplusplus
extern "C" {
#endif
/** \defgroup module_functions ATMI Module
* @{
@ -68,8 +61,6 @@ hsa_status_t atmi_memcpy_d2h(hsa_signal_t sig, void *hostDest,
/** @} */
#ifdef __cplusplus
}
#endif
#endif // INCLUDE_ATMI_RUNTIME_H_

View File

@ -4,15 +4,13 @@
* This file is distributed under the MIT License. See LICENSE.txt for details.
*===------------------------------------------------------------------------*/
#include "atmi_runtime.h"
#include "hsa_api.h"
#include "internal.h"
#include "machine.h"
#include "rt.h"
#include <cassert>
#include <hsa.h>
#include <hsa_ext_amd.h>
#include <stdio.h>
#include <string.h>
#include <thread>
#include <vector>
using core::TaskImpl;

View File

@ -0,0 +1,14 @@
//===------- hsa_api.h --------------------------------------- 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
//
//===----------------------------------------------------------------------===//
#ifndef AMDGPU_HSA_API_H_INCLUDED
#define AMDGPU_HSA_API_H_INCLUDED
#include "hsa.h"
#include "hsa_ext_amd.h"
#endif

View File

@ -12,18 +12,14 @@
#include <stdio.h>
#include <stdlib.h>
#include <atomic>
#include <cstring>
#include <deque>
#include <map>
#include <queue>
#include <string>
#include <utility>
#include <vector>
#include "hsa.h"
#include "hsa_ext_amd.h"
#include "hsa_ext_finalize.h"
#include "hsa_api.h"
#include "atmi.h"
#include "atmi_runtime.h"
@ -44,9 +40,7 @@ typedef struct atmi_implicit_args_s {
unsigned long kernarg_template_ptr;
} atmi_implicit_args_t;
#ifdef __cplusplus
extern "C" {
#endif
#ifdef DEBUG
#define DEBUG_PRINT(fmt, ...) \
@ -65,9 +59,7 @@ typedef struct hsa_signal_s {
} hsa_signal_t;
#endif
#ifdef __cplusplus
}
#endif
/* ---------------------------------------------------------------------------------
* Simulated CPU Data Structures and API

View File

@ -5,10 +5,9 @@
*===------------------------------------------------------------------------*/
#include "machine.h"
#include "atmi_runtime.h"
#include "hsa_api.h"
#include "internal.h"
#include <cassert>
#include <hsa.h>
#include <hsa_ext_amd.h>
#include <stdio.h>
#include <stdlib.h>
#include <vector>

View File

@ -6,9 +6,8 @@
#ifndef SRC_RUNTIME_INCLUDE_MACHINE_H_
#define SRC_RUNTIME_INCLUDE_MACHINE_H_
#include "atmi.h"
#include "hsa_api.h"
#include "internal.h"
#include <hsa.h>
#include <hsa_ext_amd.h>
#include <vector>
class ATLMemory;

View File

@ -7,7 +7,7 @@
#define SRC_RUNTIME_INCLUDE_RT_H_
#include "atmi_runtime.h"
#include "hsa.h"
#include "hsa_api.h"
#include <string>
namespace core {

View File

@ -24,7 +24,6 @@
#include <memory>
#include <mutex>
#include <shared_mutex>
#include <thread>
#include <unordered_map>
#include <vector>