forked from OSchip/llvm-project
[Libomptarget][NFC] Move legacy functions to a separate file
This patch moves the old legacy interfaces into `libomptarget` to a separate file. These do not need to be included anywhere and are simply provided for backwards compatibility with the ABI. This cleans up the interface greatly. Depends on D128817 Reviewed By: JonChesterfield Differential Revision: https://reviews.llvm.org/D128818
This commit is contained in:
parent
c9353eb4bc
commit
269d5c16bc
|
@ -325,45 +325,6 @@ void __tgt_target_data_update_nowait_mapper(
|
|||
// same action as data_end above. The following types are used; this
|
||||
// function returns 0 if it was able to transfer the execution to a
|
||||
// target and an int different from zero otherwise.
|
||||
int __tgt_target(int64_t DeviceId, void *HostPtr, int32_t ArgNum,
|
||||
void **ArgsBase, void **Args, int64_t *ArgSizes,
|
||||
int64_t *ArgTypes);
|
||||
int __tgt_target_nowait(int64_t DeviceId, void *HostPtr, int32_t ArgNum,
|
||||
void **ArgsBase, void **Args, int64_t *ArgSizes,
|
||||
int64_t *ArgTypes, int32_t DepNum, void *DepList,
|
||||
int32_t NoAliasDepNum, void *NoAliasDepList);
|
||||
int __tgt_target_mapper(ident_t *Loc, int64_t DeviceId, void *HostPtr,
|
||||
int32_t ArgNum, void **ArgsBase, void **Args,
|
||||
int64_t *ArgSizes, int64_t *ArgTypes,
|
||||
map_var_info_t *ArgNames, void **ArgMappers);
|
||||
int __tgt_target_nowait_mapper(ident_t *Loc, int64_t DeviceId, void *HostPtr,
|
||||
int32_t ArgNum, void **ArgsBase, void **Args,
|
||||
int64_t *ArgSizes, int64_t *ArgTypes,
|
||||
map_var_info_t *ArgNames, void **ArgMappers,
|
||||
int32_t DepNum, void *DepList,
|
||||
int32_t NoAliasDepNum, void *NoAliasDepList);
|
||||
|
||||
int __tgt_target_teams(int64_t DeviceId, void *HostPtr, int32_t ArgNum,
|
||||
void **ArgsBase, void **Args, int64_t *ArgSizes,
|
||||
int64_t *ArgTypes, int32_t NumTeams,
|
||||
int32_t ThreadLimit);
|
||||
int __tgt_target_teams_nowait(int64_t DeviceId, void *HostPtr, int32_t ArgNum,
|
||||
void **ArgsBase, void **Args, int64_t *ArgSizes,
|
||||
int64_t *ArgTypes, int32_t NumTeams,
|
||||
int32_t ThreadLimit, int32_t DepNum,
|
||||
void *DepList, int32_t NoAliasDepNum,
|
||||
void *NoAliasDepList);
|
||||
int __tgt_target_teams_mapper(ident_t *Loc, int64_t DeviceId, void *HostPtr,
|
||||
int32_t ArgNum, void **ArgsBase, void **Args,
|
||||
int64_t *ArgSizes, int64_t *ArgTypes,
|
||||
map_var_info_t *ArgNames, void **ArgMappers,
|
||||
int32_t NumTeams, int32_t ThreadLimit);
|
||||
int __tgt_target_teams_nowait_mapper(
|
||||
ident_t *loc, int64_t device_id, void *host_ptr, int32_t arg_num,
|
||||
void **args_base, void **args, int64_t *arg_sizes, int64_t *arg_types,
|
||||
map_var_info_t *arg_names, void **arg_mappers, int32_t num_teams,
|
||||
int32_t thread_limit, int32_t depNum, void *depList, int32_t noAliasDepNum,
|
||||
void *noAliasDepList);
|
||||
int __tgt_target_kernel(ident_t *Loc, int64_t DeviceId, int32_t NumTeams,
|
||||
int32_t ThreadLimit, void *HostPtr,
|
||||
__tgt_kernel_arguments *Args);
|
||||
|
@ -373,11 +334,6 @@ int __tgt_target_kernel_nowait(ident_t *Loc, int64_t DeviceId, int32_t NumTeams,
|
|||
void *DepList, int32_t NoAliasDepNum,
|
||||
void *NoAliasDepList);
|
||||
|
||||
void __kmpc_push_target_tripcount(int64_t DeviceId, uint64_t LoopTripcount);
|
||||
|
||||
void __kmpc_push_target_tripcount_mapper(ident_t *Loc, int64_t DeviceId,
|
||||
uint64_t LoopTripcount);
|
||||
|
||||
void __tgt_set_info_flag(uint32_t);
|
||||
|
||||
int __tgt_print_device_info(int64_t DeviceId);
|
||||
|
|
|
@ -19,6 +19,7 @@ set(LIBOMPTARGET_SRC_FILES
|
|||
${CMAKE_CURRENT_SOURCE_DIR}/interop.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/omptarget.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/rtl.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/LegacyAPI.cpp
|
||||
)
|
||||
|
||||
set(LIBOMPTARGET_SRC_FILES ${LIBOMPTARGET_SRC_FILES} PARENT_SCOPE)
|
||||
|
|
|
@ -0,0 +1,184 @@
|
|||
//===-------- LegacyAPI.cpp - Target independent OpenMP target RTL --------===//
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Legacy interfaces for libomptarget used to maintain backwards-compatibility.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "omptarget.h"
|
||||
#include "private.h"
|
||||
|
||||
EXTERN void __tgt_target_data_begin(int64_t DeviceId, int32_t ArgNum,
|
||||
void **ArgsBase, void **Args,
|
||||
int64_t *ArgSizes, int64_t *ArgTypes) {
|
||||
TIMESCOPE();
|
||||
__tgt_target_data_begin_mapper(nullptr, DeviceId, ArgNum, ArgsBase, Args,
|
||||
ArgSizes, ArgTypes, nullptr, nullptr);
|
||||
}
|
||||
|
||||
EXTERN void __tgt_target_data_begin_nowait(int64_t DeviceId, int32_t ArgNum,
|
||||
void **ArgsBase, void **Args,
|
||||
int64_t *ArgSizes, int64_t *ArgTypes,
|
||||
int32_t DepNum, void *DepList,
|
||||
int32_t NoAliasDepNum,
|
||||
void *NoAliasDepList) {
|
||||
TIMESCOPE();
|
||||
|
||||
__tgt_target_data_begin_mapper(nullptr, DeviceId, ArgNum, ArgsBase, Args,
|
||||
ArgSizes, ArgTypes, nullptr, nullptr);
|
||||
}
|
||||
|
||||
EXTERN void __tgt_target_data_end(int64_t DeviceId, int32_t ArgNum,
|
||||
void **ArgsBase, void **Args,
|
||||
int64_t *ArgSizes, int64_t *ArgTypes) {
|
||||
TIMESCOPE();
|
||||
__tgt_target_data_end_mapper(nullptr, DeviceId, ArgNum, ArgsBase, Args,
|
||||
ArgSizes, ArgTypes, nullptr, nullptr);
|
||||
}
|
||||
|
||||
EXTERN void __tgt_target_data_update(int64_t DeviceId, int32_t ArgNum,
|
||||
void **ArgsBase, void **Args,
|
||||
int64_t *ArgSizes, int64_t *ArgTypes) {
|
||||
TIMESCOPE();
|
||||
__tgt_target_data_update_mapper(nullptr, DeviceId, ArgNum, ArgsBase, Args,
|
||||
ArgSizes, ArgTypes, nullptr, nullptr);
|
||||
}
|
||||
|
||||
EXTERN void __tgt_target_data_update_nowait(
|
||||
int64_t DeviceId, int32_t ArgNum, void **ArgsBase, void **Args,
|
||||
int64_t *ArgSizes, int64_t *ArgTypes, int32_t DepNum, void *DepList,
|
||||
int32_t NoAliasDepNum, void *NoAliasDepList) {
|
||||
TIMESCOPE();
|
||||
|
||||
__tgt_target_data_update_mapper(nullptr, DeviceId, ArgNum, ArgsBase, Args,
|
||||
ArgSizes, ArgTypes, nullptr, nullptr);
|
||||
}
|
||||
|
||||
EXTERN void __tgt_target_data_end_nowait(int64_t DeviceId, int32_t ArgNum,
|
||||
void **ArgsBase, void **Args,
|
||||
int64_t *ArgSizes, int64_t *ArgTypes,
|
||||
int32_t DepNum, void *DepList,
|
||||
int32_t NoAliasDepNum,
|
||||
void *NoAliasDepList) {
|
||||
TIMESCOPE();
|
||||
|
||||
__tgt_target_data_end_mapper(nullptr, DeviceId, ArgNum, ArgsBase, Args,
|
||||
ArgSizes, ArgTypes, nullptr, nullptr);
|
||||
}
|
||||
|
||||
EXTERN int __tgt_target_mapper(ident_t *Loc, int64_t DeviceId, void *HostPtr,
|
||||
int32_t ArgNum, void **ArgsBase, void **Args,
|
||||
int64_t *ArgSizes, int64_t *ArgTypes,
|
||||
map_var_info_t *ArgNames, void **ArgMappers) {
|
||||
TIMESCOPE_WITH_IDENT(Loc);
|
||||
__tgt_kernel_arguments KernelArgs{
|
||||
1, ArgNum, ArgsBase, Args, ArgSizes, ArgTypes, ArgNames, ArgMappers, -1};
|
||||
return __tgt_target_kernel(Loc, DeviceId, -1, -1, HostPtr, &KernelArgs);
|
||||
}
|
||||
|
||||
EXTERN int __tgt_target(int64_t DeviceId, void *HostPtr, int32_t ArgNum,
|
||||
void **ArgsBase, void **Args, int64_t *ArgSizes,
|
||||
int64_t *ArgTypes) {
|
||||
TIMESCOPE();
|
||||
return __tgt_target_mapper(nullptr, DeviceId, HostPtr, ArgNum, ArgsBase, Args,
|
||||
ArgSizes, ArgTypes, nullptr, nullptr);
|
||||
}
|
||||
|
||||
EXTERN int __tgt_target_nowait(int64_t DeviceId, void *HostPtr, int32_t ArgNum,
|
||||
void **ArgsBase, void **Args, int64_t *ArgSizes,
|
||||
int64_t *ArgTypes, int32_t DepNum, void *DepList,
|
||||
int32_t NoAliasDepNum, void *NoAliasDepList) {
|
||||
TIMESCOPE();
|
||||
|
||||
return __tgt_target_mapper(nullptr, DeviceId, HostPtr, ArgNum, ArgsBase, Args,
|
||||
ArgSizes, ArgTypes, nullptr, nullptr);
|
||||
}
|
||||
|
||||
EXTERN int __tgt_target_nowait_mapper(
|
||||
ident_t *Loc, int64_t DeviceId, void *HostPtr, int32_t ArgNum,
|
||||
void **ArgsBase, void **Args, int64_t *ArgSizes, int64_t *ArgTypes,
|
||||
map_var_info_t *ArgNames, void **ArgMappers, int32_t DepNum, void *DepList,
|
||||
int32_t NoAliasDepNum, void *NoAliasDepList) {
|
||||
TIMESCOPE_WITH_IDENT(Loc);
|
||||
|
||||
return __tgt_target_mapper(Loc, DeviceId, HostPtr, ArgNum, ArgsBase, Args,
|
||||
ArgSizes, ArgTypes, ArgNames, ArgMappers);
|
||||
}
|
||||
|
||||
EXTERN int __tgt_target_teams_mapper(ident_t *Loc, int64_t DeviceId,
|
||||
void *HostPtr, int32_t ArgNum,
|
||||
void **ArgsBase, void **Args,
|
||||
int64_t *ArgSizes, int64_t *ArgTypes,
|
||||
map_var_info_t *ArgNames,
|
||||
void **ArgMappers, int32_t NumTeams,
|
||||
int32_t ThreadLimit) {
|
||||
TIMESCOPE_WITH_IDENT(Loc);
|
||||
|
||||
__tgt_kernel_arguments KernelArgs{
|
||||
1, ArgNum, ArgsBase, Args, ArgSizes, ArgTypes, ArgNames, ArgMappers, -1};
|
||||
return __tgt_target_kernel(Loc, DeviceId, NumTeams, ThreadLimit, HostPtr,
|
||||
&KernelArgs);
|
||||
}
|
||||
|
||||
EXTERN int __tgt_target_teams(int64_t DeviceId, void *HostPtr, int32_t ArgNum,
|
||||
void **ArgsBase, void **Args, int64_t *ArgSizes,
|
||||
int64_t *ArgTypes, int32_t NumTeams,
|
||||
int32_t ThreadLimit) {
|
||||
TIMESCOPE();
|
||||
return __tgt_target_teams_mapper(nullptr, DeviceId, HostPtr, ArgNum, ArgsBase,
|
||||
Args, ArgSizes, ArgTypes, nullptr, nullptr,
|
||||
NumTeams, ThreadLimit);
|
||||
}
|
||||
|
||||
EXTERN int __tgt_target_teams_nowait(int64_t DeviceId, void *HostPtr,
|
||||
int32_t ArgNum, void **ArgsBase,
|
||||
void **Args, int64_t *ArgSizes,
|
||||
int64_t *ArgTypes, int32_t NumTeams,
|
||||
int32_t ThreadLimit, int32_t DepNum,
|
||||
void *DepList, int32_t NoAliasDepNum,
|
||||
void *NoAliasDepList) {
|
||||
TIMESCOPE();
|
||||
|
||||
return __tgt_target_teams_mapper(nullptr, DeviceId, HostPtr, ArgNum, ArgsBase,
|
||||
Args, ArgSizes, ArgTypes, nullptr, nullptr,
|
||||
NumTeams, ThreadLimit);
|
||||
}
|
||||
|
||||
EXTERN int __tgt_target_teams_nowait_mapper(
|
||||
ident_t *Loc, int64_t DeviceId, void *HostPtr, int32_t ArgNum,
|
||||
void **ArgsBase, void **Args, int64_t *ArgSizes, int64_t *ArgTypes,
|
||||
map_var_info_t *ArgNames, void **ArgMappers, int32_t NumTeams,
|
||||
int32_t ThreadLimit, int32_t DepNum, void *DepList, int32_t NoAliasDepNum,
|
||||
void *NoAliasDepList) {
|
||||
TIMESCOPE_WITH_IDENT(Loc);
|
||||
|
||||
return __tgt_target_teams_mapper(Loc, DeviceId, HostPtr, ArgNum, ArgsBase,
|
||||
Args, ArgSizes, ArgTypes, ArgNames,
|
||||
ArgMappers, NumTeams, ThreadLimit);
|
||||
}
|
||||
|
||||
EXTERN void __kmpc_push_target_tripcount_mapper(ident_t *Loc, int64_t DeviceId,
|
||||
uint64_t LoopTripcount) {
|
||||
TIMESCOPE_WITH_IDENT(Loc);
|
||||
if (checkDeviceAndCtors(DeviceId, Loc)) {
|
||||
DP("Not offloading to device %" PRId64 "\n", DeviceId);
|
||||
return;
|
||||
}
|
||||
|
||||
DP("__kmpc_push_target_tripcount(%" PRId64 ", %" PRIu64 ")\n", DeviceId,
|
||||
LoopTripcount);
|
||||
PM->TblMapMtx.lock();
|
||||
PM->Devices[DeviceId]->LoopTripCnt.emplace(__kmpc_global_thread_num(NULL),
|
||||
LoopTripcount);
|
||||
PM->TblMapMtx.unlock();
|
||||
}
|
||||
|
||||
EXTERN void __kmpc_push_target_tripcount(int64_t DeviceId,
|
||||
uint64_t LoopTripcount) {
|
||||
__kmpc_push_target_tripcount_mapper(nullptr, DeviceId, LoopTripcount);
|
||||
}
|
|
@ -64,26 +64,6 @@ EXTERN void __tgt_unregister_lib(__tgt_bin_desc *Desc) {
|
|||
/// creates host-to-target data mapping, stores it in the
|
||||
/// libomptarget.so internal structure (an entry in a stack of data maps)
|
||||
/// and passes the data to the device.
|
||||
EXTERN void __tgt_target_data_begin(int64_t DeviceId, int32_t ArgNum,
|
||||
void **ArgsBase, void **Args,
|
||||
int64_t *ArgSizes, int64_t *ArgTypes) {
|
||||
TIMESCOPE();
|
||||
__tgt_target_data_begin_mapper(nullptr, DeviceId, ArgNum, ArgsBase, Args,
|
||||
ArgSizes, ArgTypes, nullptr, nullptr);
|
||||
}
|
||||
|
||||
EXTERN void __tgt_target_data_begin_nowait(int64_t DeviceId, int32_t ArgNum,
|
||||
void **ArgsBase, void **Args,
|
||||
int64_t *ArgSizes, int64_t *ArgTypes,
|
||||
int32_t DepNum, void *DepList,
|
||||
int32_t NoAliasDepNum,
|
||||
void *NoAliasDepList) {
|
||||
TIMESCOPE();
|
||||
|
||||
__tgt_target_data_begin_mapper(nullptr, DeviceId, ArgNum, ArgsBase, Args,
|
||||
ArgSizes, ArgTypes, nullptr, nullptr);
|
||||
}
|
||||
|
||||
EXTERN void __tgt_target_data_begin_mapper(ident_t *Loc, int64_t DeviceId,
|
||||
int32_t ArgNum, void **ArgsBase,
|
||||
void **Args, int64_t *ArgSizes,
|
||||
|
@ -134,26 +114,6 @@ EXTERN void __tgt_target_data_begin_nowait_mapper(
|
|||
/// passes data from the target, releases target memory and destroys
|
||||
/// the host-target mapping (top entry from the stack of data maps)
|
||||
/// created by the last __tgt_target_data_begin.
|
||||
EXTERN void __tgt_target_data_end(int64_t DeviceId, int32_t ArgNum,
|
||||
void **ArgsBase, void **Args,
|
||||
int64_t *ArgSizes, int64_t *ArgTypes) {
|
||||
TIMESCOPE();
|
||||
__tgt_target_data_end_mapper(nullptr, DeviceId, ArgNum, ArgsBase, Args,
|
||||
ArgSizes, ArgTypes, nullptr, nullptr);
|
||||
}
|
||||
|
||||
EXTERN void __tgt_target_data_end_nowait(int64_t DeviceId, int32_t ArgNum,
|
||||
void **ArgsBase, void **Args,
|
||||
int64_t *ArgSizes, int64_t *ArgTypes,
|
||||
int32_t DepNum, void *DepList,
|
||||
int32_t NoAliasDepNum,
|
||||
void *NoAliasDepList) {
|
||||
TIMESCOPE();
|
||||
|
||||
__tgt_target_data_end_mapper(nullptr, DeviceId, ArgNum, ArgsBase, Args,
|
||||
ArgSizes, ArgTypes, nullptr, nullptr);
|
||||
}
|
||||
|
||||
EXTERN void __tgt_target_data_end_mapper(ident_t *Loc, int64_t DeviceId,
|
||||
int32_t ArgNum, void **ArgsBase,
|
||||
void **Args, int64_t *ArgSizes,
|
||||
|
@ -200,24 +160,6 @@ EXTERN void __tgt_target_data_end_nowait_mapper(
|
|||
ArgTypes, ArgNames, ArgMappers);
|
||||
}
|
||||
|
||||
EXTERN void __tgt_target_data_update(int64_t DeviceId, int32_t ArgNum,
|
||||
void **ArgsBase, void **Args,
|
||||
int64_t *ArgSizes, int64_t *ArgTypes) {
|
||||
TIMESCOPE();
|
||||
__tgt_target_data_update_mapper(nullptr, DeviceId, ArgNum, ArgsBase, Args,
|
||||
ArgSizes, ArgTypes, nullptr, nullptr);
|
||||
}
|
||||
|
||||
EXTERN void __tgt_target_data_update_nowait(
|
||||
int64_t DeviceId, int32_t ArgNum, void **ArgsBase, void **Args,
|
||||
int64_t *ArgSizes, int64_t *ArgTypes, int32_t DepNum, void *DepList,
|
||||
int32_t NoAliasDepNum, void *NoAliasDepList) {
|
||||
TIMESCOPE();
|
||||
|
||||
__tgt_target_data_update_mapper(nullptr, DeviceId, ArgNum, ArgsBase, Args,
|
||||
ArgSizes, ArgTypes, nullptr, nullptr);
|
||||
}
|
||||
|
||||
EXTERN void __tgt_target_data_update_mapper(ident_t *Loc, int64_t DeviceId,
|
||||
int32_t ArgNum, void **ArgsBase,
|
||||
void **Args, int64_t *ArgSizes,
|
||||
|
@ -255,83 +197,6 @@ EXTERN void __tgt_target_data_update_nowait_mapper(
|
|||
ArgSizes, ArgTypes, ArgNames, ArgMappers);
|
||||
}
|
||||
|
||||
EXTERN int __tgt_target(int64_t DeviceId, void *HostPtr, int32_t ArgNum,
|
||||
void **ArgsBase, void **Args, int64_t *ArgSizes,
|
||||
int64_t *ArgTypes) {
|
||||
TIMESCOPE();
|
||||
return __tgt_target_mapper(nullptr, DeviceId, HostPtr, ArgNum, ArgsBase, Args,
|
||||
ArgSizes, ArgTypes, nullptr, nullptr);
|
||||
}
|
||||
|
||||
EXTERN int __tgt_target_nowait(int64_t DeviceId, void *HostPtr, int32_t ArgNum,
|
||||
void **ArgsBase, void **Args, int64_t *ArgSizes,
|
||||
int64_t *ArgTypes, int32_t DepNum, void *DepList,
|
||||
int32_t NoAliasDepNum, void *NoAliasDepList) {
|
||||
TIMESCOPE();
|
||||
|
||||
return __tgt_target_mapper(nullptr, DeviceId, HostPtr, ArgNum, ArgsBase, Args,
|
||||
ArgSizes, ArgTypes, nullptr, nullptr);
|
||||
}
|
||||
|
||||
EXTERN int __tgt_target_mapper(ident_t *Loc, int64_t DeviceId, void *HostPtr,
|
||||
int32_t ArgNum, void **ArgsBase, void **Args,
|
||||
int64_t *ArgSizes, int64_t *ArgTypes,
|
||||
map_var_info_t *ArgNames, void **ArgMappers) {
|
||||
TIMESCOPE_WITH_IDENT(Loc);
|
||||
__tgt_kernel_arguments KernelArgs{
|
||||
1, ArgNum, ArgsBase, Args, ArgSizes, ArgTypes, ArgNames, ArgMappers, -1};
|
||||
return __tgt_target_kernel(Loc, DeviceId, -1, 0, HostPtr, &KernelArgs);
|
||||
}
|
||||
|
||||
EXTERN int __tgt_target_nowait_mapper(
|
||||
ident_t *Loc, int64_t DeviceId, void *HostPtr, int32_t ArgNum,
|
||||
void **ArgsBase, void **Args, int64_t *ArgSizes, int64_t *ArgTypes,
|
||||
map_var_info_t *ArgNames, void **ArgMappers, int32_t DepNum, void *DepList,
|
||||
int32_t NoAliasDepNum, void *NoAliasDepList) {
|
||||
TIMESCOPE_WITH_IDENT(Loc);
|
||||
|
||||
return __tgt_target_mapper(Loc, DeviceId, HostPtr, ArgNum, ArgsBase, Args,
|
||||
ArgSizes, ArgTypes, ArgNames, ArgMappers);
|
||||
}
|
||||
|
||||
EXTERN int __tgt_target_teams(int64_t DeviceId, void *HostPtr, int32_t ArgNum,
|
||||
void **ArgsBase, void **Args, int64_t *ArgSizes,
|
||||
int64_t *ArgTypes, int32_t TeamNum,
|
||||
int32_t ThreadLimit) {
|
||||
TIMESCOPE();
|
||||
return __tgt_target_teams_mapper(nullptr, DeviceId, HostPtr, ArgNum, ArgsBase,
|
||||
Args, ArgSizes, ArgTypes, nullptr, nullptr,
|
||||
TeamNum, ThreadLimit);
|
||||
}
|
||||
|
||||
EXTERN int __tgt_target_teams_nowait(int64_t DeviceId, void *HostPtr,
|
||||
int32_t ArgNum, void **ArgsBase,
|
||||
void **Args, int64_t *ArgSizes,
|
||||
int64_t *ArgTypes, int32_t TeamNum,
|
||||
int32_t ThreadLimit, int32_t DepNum,
|
||||
void *DepList, int32_t NoAliasDepNum,
|
||||
void *NoAliasDepList) {
|
||||
TIMESCOPE();
|
||||
|
||||
return __tgt_target_teams_mapper(nullptr, DeviceId, HostPtr, ArgNum, ArgsBase,
|
||||
Args, ArgSizes, ArgTypes, nullptr, nullptr,
|
||||
TeamNum, ThreadLimit);
|
||||
}
|
||||
|
||||
EXTERN int __tgt_target_teams_mapper(ident_t *Loc, int64_t DeviceId,
|
||||
void *HostPtr, int32_t ArgNum,
|
||||
void **ArgsBase, void **Args,
|
||||
int64_t *ArgSizes, int64_t *ArgTypes,
|
||||
map_var_info_t *ArgNames,
|
||||
void **ArgMappers, int32_t TeamNum,
|
||||
int32_t ThreadLimit) {
|
||||
TIMESCOPE_WITH_IDENT(Loc);
|
||||
__tgt_kernel_arguments KernelArgs{
|
||||
1, ArgNum, ArgsBase, Args, ArgSizes, ArgTypes, ArgNames, ArgMappers, -1};
|
||||
return __tgt_target_kernel(Loc, DeviceId, TeamNum, ThreadLimit, HostPtr,
|
||||
&KernelArgs);
|
||||
}
|
||||
|
||||
/// Implements a kernel entry that executes the target region on the specified
|
||||
/// device.
|
||||
///
|
||||
|
@ -425,27 +290,6 @@ EXTERN void __tgt_push_mapper_component(void *RtMapperHandle, void *Base,
|
|||
MapComponentInfoTy(Base, Begin, Size, Type, Name));
|
||||
}
|
||||
|
||||
EXTERN void __kmpc_push_target_tripcount(int64_t DeviceId,
|
||||
uint64_t LoopTripcount) {
|
||||
__kmpc_push_target_tripcount_mapper(nullptr, DeviceId, LoopTripcount);
|
||||
}
|
||||
|
||||
EXTERN void __kmpc_push_target_tripcount_mapper(ident_t *Loc, int64_t DeviceId,
|
||||
uint64_t LoopTripcount) {
|
||||
TIMESCOPE_WITH_IDENT(Loc);
|
||||
if (checkDeviceAndCtors(DeviceId, Loc)) {
|
||||
DP("Not offloading to device %" PRId64 "\n", DeviceId);
|
||||
return;
|
||||
}
|
||||
|
||||
DP("__kmpc_push_target_tripcount(%" PRId64 ", %" PRIu64 ")\n", DeviceId,
|
||||
LoopTripcount);
|
||||
PM->TblMapMtx.lock();
|
||||
PM->Devices[DeviceId]->LoopTripCnt.emplace(__kmpc_global_thread_num(NULL),
|
||||
LoopTripcount);
|
||||
PM->TblMapMtx.unlock();
|
||||
}
|
||||
|
||||
EXTERN void __tgt_set_info_flag(uint32_t NewInfoLevel) {
|
||||
std::atomic<uint32_t> &InfoLevel = getInfoLevelInternal();
|
||||
InfoLevel.store(NewInfoLevel);
|
||||
|
|
Loading…
Reference in New Issue