// a SIMD => wavefront mapping once that is implemented.
//
//===----------------------------------------------------------------------===//
+#pragma omp declare target
#include "common/debug.h"
DEVICE void __kmpc_impl_set_lock(omp_lock_t *) { warn(); }
DEVICE void __kmpc_impl_unset_lock(omp_lock_t *) { warn(); }
DEVICE int __kmpc_impl_test_lock(omp_lock_t *lock) { warn(); }
+
+#pragma omp end declare target
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
+#pragma omp declare target
#include "target_impl.h"
ENCODE_HWREG(HW_ID_SE_ID_SIZE, HW_ID_SE_ID_OFFSET, HW_ID));
return (se_id << HW_ID_CU_ID_SIZE) + cu_id;
}
+
+#pragma omp end declare target
// Definitions of target specific functions
//
//===----------------------------------------------------------------------===//
+#pragma omp declare target
#include "target_impl.h"
// Stub implementations
DEVICE void *__kmpc_impl_malloc(size_t) { return nullptr; }
DEVICE void __kmpc_impl_free(void *) {}
+
+#pragma omp end declare target
// Interface to be used in the implementation of OpenMP cancel.
//
//===----------------------------------------------------------------------===//
+#pragma omp declare target
#include "interface.h"
#include "common/debug.h"
// disabled
return 0;
}
+
+#pragma omp end declare target
// This file contains the implementation of critical with KMPC interface
//
//===----------------------------------------------------------------------===//
+#pragma omp declare target
#include "interface.h"
#include "common/debug.h"
PRINT0(LD_IO, "call to kmpc_end_critical()\n");
omp_unset_lock((omp_lock_t *)lck);
}
+
+#pragma omp end declare target
// This file contains the implementation of data sharing environments
//
//===----------------------------------------------------------------------===//
+#pragma omp declare target
+
#include "common/omptarget.h"
#include "target_impl.h"
omptarget_nvptx_simpleMemoryManager.Release();
}
+#pragma omp end declare target
// invoked by the user in an OpenMP region
//
//===----------------------------------------------------------------------===//
+#pragma omp declare target
#include "common/omptarget.h"
#include "common/target_atomic.h"
PRINT(LD_IO, "call omp_test_lock() return %d\n", rc);
return rc;
}
+
+#pragma omp end declare target
// interface as loops.
//
//===----------------------------------------------------------------------===//
+#pragma omp declare target
#include "common/omptarget.h"
#include "target_impl.h"
EXTERN void __kmpc_for_static_fini(kmp_Ident *loc, int32_t global_tid) {
PRINT0(LD_IO, "call kmpc_for_static_fini\n");
}
+
+#pragma omp end declare target
// This file contains the data objects used on the GPU device.
//
//===----------------------------------------------------------------------===//
+#pragma omp declare target
#include "common/omptarget.h"
#include "common/device_environment.h"
// Data sharing related variables.
////////////////////////////////////////////////////////////////////////////////
DEVICE SHARED omptarget_nvptx_SharedArgs omptarget_nvptx_globalArgs;
+
+#pragma omp end declare target
// This file contains the initialization code for the GPU
//
//===----------------------------------------------------------------------===//
+#pragma omp declare target
#include "common/omptarget.h"
#include "target_impl.h"
PRINT0(LD_IO | LD_PAR, "call to __kmpc_is_spmd_exec_mode\n");
return isSPMDMode();
}
+
+#pragma omp end declare target
// To make a long story short...
//
//===----------------------------------------------------------------------===//
+#pragma omp declare target
#include "common/omptarget.h"
#include "target_impl.h"
int proc_bind) {
PRINT(LD_IO, "call kmpc_push_proc_bind %d\n", (int)proc_bind);
}
+
+#pragma omp end declare target
// This file contains the implementation of reduction with KMPC interface.
//
//===----------------------------------------------------------------------===//
+#pragma omp declare target
#include "common/omptarget.h"
#include "common/target_atomic.h"
return 0;
}
+#pragma omp end declare target
// Wrapper implementation to some functions natively supported by the GPU.
//
//===----------------------------------------------------------------------===//
+#pragma omp declare target
#include "common/support.h"
#include "common/debug.h"
return static_cast<char *>(ReductionScratchpadPtr) + 256;
}
+#pragma omp end declare target
// Include all synchronization.
//
//===----------------------------------------------------------------------===//
+#pragma omp declare target
#include "common/omptarget.h"
#include "target_impl.h"
PRINT0(LD_IO, "call __kmpc_syncwarp\n");
__kmpc_impl_syncwarp(Mask);
}
+
+#pragma omp end declare target
// - end
//
//===----------------------------------------------------------------------===//
+#pragma omp declare target
#include "common/omptarget.h"
__kmpc_omp_task_with_deps(loc, global_tid, newKmpTaskDescr, 0, 0, 0, 0);
}
+
+#pragma omp end declare target
// Definitions of target specific functions
//
//===----------------------------------------------------------------------===//
+#pragma omp declare target
#include "target_impl.h"
#include "common/debug.h"
DEVICE void *__kmpc_impl_malloc(size_t x) { return malloc(x); }
DEVICE void __kmpc_impl_free(void *x) { free(x); }
+
+#pragma omp end declare target