[Openmp-commits] [openmp] [libomptarget][OpenMP] Initial implementation of omp_target_memset() and omp_target_memset_async() (PR #68706)
Jan Patrick Lehr via Openmp-commits
openmp-commits at lists.llvm.org
Thu Oct 19 05:21:30 PDT 2023
================
@@ -241,47 +241,129 @@ static int libomp_target_memcpy_async_helper(kmp_int32 Gtid, kmp_task_t *Task) {
return Rc;
}
-// Allocate and launch helper task
-static int libomp_helper_task_creation(TargetMemcpyArgsTy *Args,
- int DepObjCount,
- omp_depend_t *DepObjList) {
+static int libomp_target_memset_async_task(kmp_int32 Gtid, kmp_task_t *Task) {
+ if (!Task)
+ return OFFLOAD_FAIL;
+
+ auto *Args = reinterpret_cast<TargetMemsetArgsTy *>(Task->shareds);
+ if (!Args)
+ return OFFLOAD_FAIL;
+
+ // call omp_target_memset()
+ omp_target_memset(Args->Ptr, Args->C, Args->N, Args->DeviceNum);
+
+ delete Args;
+
+ return OFFLOAD_SUCCESS;
+}
+
+static inline void
+ConvertDepObjVector(llvm::SmallVector<kmp_depend_info_t> &Vec, int DepObjCount,
----------------
jplehr wrote:
Shouldn't this function name be lower case?
https://github.com/llvm/llvm-project/pull/68706
More information about the Openmp-commits
mailing list