Changeset View
Changeset View
Standalone View
Standalone View
openmp/trunk/libomptarget/deviceRTLs/nvptx/src/interface.h
//===------- interface.h - NVPTX OpenMP interface definitions ---- CUDA -*-===// | //===------- interface.h - NVPTX OpenMP interface definitions ---- CUDA -*-===// | ||||
// | // | ||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||||
// See https://llvm.org/LICENSE.txt for license information. | // See https://llvm.org/LICENSE.txt for license information. | ||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||||
// | // | ||||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||||
// | // | ||||
// This file contains debug macros to be used in the application. | // This file contains debug macros to be used in the application. | ||||
// | // | ||||
// This file contains all the definitions that are relevant to | // This file contains all the definitions that are relevant to | ||||
// the interface. The first section contains the interface as | // the interface. The first section contains the interface as | ||||
// declared by OpenMP. A second section includes library private calls | // declared by OpenMP. The second section includes the compiler | ||||
// (mostly debug, temporary?) The third section includes the compiler | |||||
// specific interfaces. | // specific interfaces. | ||||
// | // | ||||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||||
#ifndef _INTERFACES_H_ | #ifndef _INTERFACES_H_ | ||||
#define _INTERFACES_H_ | #define _INTERFACES_H_ | ||||
#include "option.h" | #include "option.h" | ||||
▲ Show 20 Lines • Show All 183 Lines • ▼ Show 20 Lines | |||||
typedef struct kmp_TaskDescr kmp_TaskDescr; | typedef struct kmp_TaskDescr kmp_TaskDescr; | ||||
typedef int32_t (*kmp_TaskFctPtr)(int32_t global_tid, kmp_TaskDescr *taskDescr); | typedef int32_t (*kmp_TaskFctPtr)(int32_t global_tid, kmp_TaskDescr *taskDescr); | ||||
typedef struct kmp_TaskDescr { | typedef struct kmp_TaskDescr { | ||||
void *sharedPointerTable; // ptr to a table of shared var ptrs | void *sharedPointerTable; // ptr to a table of shared var ptrs | ||||
kmp_TaskFctPtr sub; // task subroutine | kmp_TaskFctPtr sub; // task subroutine | ||||
int32_t partId; // unused | int32_t partId; // unused | ||||
kmp_TaskFctPtr destructors; // destructor of c++ first private | kmp_TaskFctPtr destructors; // destructor of c++ first private | ||||
} kmp_TaskDescr; | } kmp_TaskDescr; | ||||
// task dep defs | |||||
#define KMP_TASKDEP_IN 0x1u | |||||
#define KMP_TASKDEP_OUT 0x2u | |||||
typedef struct kmp_TaskDep_Public { | |||||
void *addr; | |||||
size_t len; | |||||
uint8_t flags; // bit 0: in, bit 1: out | |||||
} kmp_TaskDep_Public; | |||||
// flags that interpret the interface part of tasking flags | |||||
#define KMP_TASK_IS_TIED 0x1 | |||||
#define KMP_TASK_FINAL 0x2 | |||||
#define KMP_TASK_MERGED_IF0 0x4 /* unused */ | |||||
#define KMP_TASK_DESTRUCTOR_THUNK 0x8 | |||||
// flags for task setup return | |||||
#define KMP_CURRENT_TASK_NOT_SUSPENDED 0 | |||||
#define KMP_CURRENT_TASK_SUSPENDED 1 | |||||
// sync defs | // sync defs | ||||
typedef int32_t kmp_CriticalName[8]; | typedef int32_t kmp_CriticalName[8]; | ||||
//////////////////////////////////////////////////////////////////////////////// | //////////////////////////////////////////////////////////////////////////////// | ||||
// flags for kstate (all bits initially off) | |||||
//////////////////////////////////////////////////////////////////////////////// | |||||
// first 2 bits used by kmp_Reduction (defined in kmp_reduction.cpp) | |||||
#define KMP_REDUCTION_MASK 0x3 | |||||
#define KMP_SKIP_NEXT_CALL 0x4 | |||||
#define KMP_SKIP_NEXT_CANCEL_BARRIER 0x8 | |||||
//////////////////////////////////////////////////////////////////////////////// | |||||
// data | |||||
//////////////////////////////////////////////////////////////////////////////// | |||||
//////////////////////////////////////////////////////////////////////////////// | |||||
// external interface | // external interface | ||||
//////////////////////////////////////////////////////////////////////////////// | //////////////////////////////////////////////////////////////////////////////// | ||||
// query | |||||
EXTERN int32_t __kmpc_global_num_threads(kmp_Ident *loc); // missing | |||||
EXTERN int32_t __kmpc_bound_thread_num(kmp_Ident *loc); // missing | |||||
EXTERN int32_t __kmpc_bound_num_threads(kmp_Ident *loc); // missing | |||||
EXTERN int32_t __kmpc_in_parallel(kmp_Ident *loc); // missing | |||||
// parallel | // parallel | ||||
EXTERN int32_t __kmpc_global_thread_num(kmp_Ident *loc); | EXTERN int32_t __kmpc_global_thread_num(kmp_Ident *loc); | ||||
EXTERN void __kmpc_push_num_threads(kmp_Ident *loc, int32_t global_tid, | EXTERN void __kmpc_push_num_threads(kmp_Ident *loc, int32_t global_tid, | ||||
int32_t num_threads); | int32_t num_threads); | ||||
// simd | // simd | ||||
EXTERN void __kmpc_push_simd_limit(kmp_Ident *loc, int32_t global_tid, | EXTERN void __kmpc_push_simd_limit(kmp_Ident *loc, int32_t global_tid, | ||||
int32_t simd_limit); | int32_t simd_limit); | ||||
// aee ... not supported | // aee ... not supported | ||||
▲ Show 20 Lines • Show All 304 Lines • Show Last 20 Lines |