DPxPTR(src), dst_offset, src_offset, length);
if (!dst || !src || length <= 0) {
- DP("Call to omp_target_memcpy with invalid arguments\n");
+ REPORT("Call to omp_target_memcpy with invalid arguments\n");
return OFFLOAD_FAIL;
}
if (src_device != omp_get_initial_device() && !device_is_ready(src_device)) {
- DP("omp_target_memcpy returns OFFLOAD_FAIL\n");
- return OFFLOAD_FAIL;
+ REPORT("omp_target_memcpy returns OFFLOAD_FAIL\n");
+ return OFFLOAD_FAIL;
}
if (dst_device != omp_get_initial_device() && !device_is_ready(dst_device)) {
- DP("omp_target_memcpy returns OFFLOAD_FAIL\n");
- return OFFLOAD_FAIL;
+ REPORT("omp_target_memcpy returns OFFLOAD_FAIL\n");
+ return OFFLOAD_FAIL;
}
int rc = OFFLOAD_SUCCESS;
if (!dst || !src || element_size < 1 || num_dims < 1 || !volume ||
!dst_offsets || !src_offsets || !dst_dimensions || !src_dimensions) {
- DP("Call to omp_target_memcpy_rect with invalid arguments\n");
+ REPORT("Call to omp_target_memcpy_rect with invalid arguments\n");
return OFFLOAD_FAIL;
}
DPxPTR(host_ptr), DPxPTR(device_ptr), size, device_offset, device_num);
if (!host_ptr || !device_ptr || size <= 0) {
- DP("Call to omp_target_associate_ptr with invalid arguments\n");
+ REPORT("Call to omp_target_associate_ptr with invalid arguments\n");
return OFFLOAD_FAIL;
}
if (device_num == omp_get_initial_device()) {
- DP("omp_target_associate_ptr: no association possible on the host\n");
+ REPORT("omp_target_associate_ptr: no association possible on the host\n");
return OFFLOAD_FAIL;
}
if (!device_is_ready(device_num)) {
- DP("omp_target_associate_ptr returns OFFLOAD_FAIL\n");
+ REPORT("omp_target_associate_ptr returns OFFLOAD_FAIL\n");
return OFFLOAD_FAIL;
}
"device_num %d\n", DPxPTR(host_ptr), device_num);
if (!host_ptr) {
- DP("Call to omp_target_associate_ptr with invalid host_ptr\n");
+ REPORT("Call to omp_target_associate_ptr with invalid host_ptr\n");
return OFFLOAD_FAIL;
}
if (device_num == omp_get_initial_device()) {
- DP("omp_target_disassociate_ptr: no association possible on the host\n");
+ REPORT(
+ "omp_target_disassociate_ptr: no association possible on the host\n");
return OFFLOAD_FAIL;
}
if (!device_is_ready(device_num)) {
- DP("omp_target_disassociate_ptr returns OFFLOAD_FAIL\n");
+ REPORT("omp_target_disassociate_ptr returns OFFLOAD_FAIL\n");
return OFFLOAD_FAIL;
}
#ifdef OMPTARGET_DEBUG
int DebugLevel = 0;
#endif // OMPTARGET_DEBUG
-
-
+int InfoLevel = 0;
/* All begin addresses for partially mapped structs must be 8-aligned in order
* to ensure proper alignment of members. E.g.
"Not expecting a device ID outside the table's bounds!");
__tgt_device_image *img = TransTable->TargetsImages[device_id];
if (!img) {
- DP("No image loaded for device id %d.\n", device_id);
+ REPORT("No image loaded for device id %d.\n", device_id);
rc = OFFLOAD_FAIL;
break;
}
TransTable->TargetsTable[device_id] = Device.load_binary(img);
// Unable to get table for this image: invalidate image and fail.
if (!TargetTable) {
- DP("Unable to generate entries table for device id %d.\n", device_id);
+ REPORT("Unable to generate entries table for device id %d.\n", device_id);
TransTable->TargetsImages[device_id] = 0;
rc = OFFLOAD_FAIL;
break;
// Invalid image for these host entries!
if (hsize != tsize) {
- DP("Host and Target tables mismatch for device id %d [%zx != %zx].\n",
- device_id, hsize, tsize);
+ REPORT("Host and Target tables mismatch for device id %d [%zx != %zx].\n",
+ device_id, hsize, tsize);
TransTable->TargetsImages[device_id] = 0;
TransTable->TargetsTable[device_id] = 0;
rc = OFFLOAD_FAIL;
int rc = target(device_id, ctor, 0, NULL, NULL, NULL, NULL, NULL, 1,
1, true /*team*/);
if (rc != OFFLOAD_SUCCESS) {
- DP("Running ctor " DPxMOD " failed.\n", DPxPTR(ctor));
+ REPORT("Running ctor " DPxMOD " failed.\n", DPxPTR(ctor));
Device.PendingGlobalsMtx.unlock();
return OFFLOAD_FAIL;
}
int CheckDeviceAndCtors(int64_t device_id) {
// Is device ready?
if (!device_is_ready(device_id)) {
- DP("Device %" PRId64 " is not ready.\n", device_id);
+ REPORT("Device %" PRId64 " is not ready.\n", device_id);
return OFFLOAD_FAIL;
}
bool hasPendingGlobals = Device.HasPendingGlobals;
Device.PendingGlobalsMtx.unlock();
if (hasPendingGlobals && InitLibrary(Device) != OFFLOAD_SUCCESS) {
- DP("Failed to init globals on device %" PRId64 "\n", device_id);
+ REPORT("Failed to init globals on device %" PRId64 "\n", device_id);
return OFFLOAD_FAIL;
}
arg_types[i], arg_mappers[i], targetDataBegin);
if (rc != OFFLOAD_SUCCESS) {
- DP("Call to targetDataBegin via targetDataMapper for custom mapper"
- " failed.\n");
+ REPORT("Call to targetDataBegin via targetDataMapper for custom mapper"
+ " failed.\n");
return OFFLOAD_FAIL;
}
HstPtrBase, HstPtrBase, sizeof(void *), Pointer_IsNew, IsHostPtr,
IsImplicit, UpdateRef, HasCloseModifier, HasPresentModifier);
if (!PointerTgtPtrBegin) {
- DP("Call to getOrAllocTgtPtr returned null pointer (%s).\n",
- HasPresentModifier ? "'present' map type modifier"
- : "device failure or illegal mapping");
+ REPORT("Call to getOrAllocTgtPtr returned null pointer (%s).\n",
+ HasPresentModifier ? "'present' map type modifier"
+ : "device failure or illegal mapping");
return OFFLOAD_FAIL;
}
DP("There are %zu bytes allocated at target address " DPxMOD " - is%s new"
// If data_size==0, then the argument could be a zero-length pointer to
// NULL, so getOrAlloc() returning NULL is not an error.
if (!TgtPtrBegin && (data_size || HasPresentModifier)) {
- DP("Call to getOrAllocTgtPtr returned null pointer (%s).\n",
- HasPresentModifier ? "'present' map type modifier"
- : "device failure or illegal mapping");
+ REPORT("Call to getOrAllocTgtPtr returned null pointer (%s).\n",
+ HasPresentModifier ? "'present' map type modifier"
+ : "device failure or illegal mapping");
return OFFLOAD_FAIL;
}
DP("There are %" PRId64 " bytes allocated at target address " DPxMOD
int rt = Device.submitData(TgtPtrBegin, HstPtrBegin, data_size,
async_info_ptr);
if (rt != OFFLOAD_SUCCESS) {
- DP("Copying data to device failed.\n");
+ REPORT("Copying data to device failed.\n");
return OFFLOAD_FAIL;
}
}
int rt = Device.submitData(PointerTgtPtrBegin, &TgtPtrBase,
sizeof(void *), async_info_ptr);
if (rt != OFFLOAD_SUCCESS) {
- DP("Copying data to device failed.\n");
+ REPORT("Copying data to device failed.\n");
return OFFLOAD_FAIL;
}
// create shadow pointers for this entry
ArgTypes[I], ArgMappers[I], targetDataEnd);
if (Ret != OFFLOAD_SUCCESS) {
- DP("Call to targetDataEnd via targetDataMapper for custom mapper"
- " failed.\n");
+ REPORT("Call to targetDataEnd via targetDataMapper for custom mapper"
+ " failed.\n");
return OFFLOAD_FAIL;
}
Ret = Device.retrieveData(HstPtrBegin, TgtPtrBegin, DataSize,
AsyncInfo);
if (Ret != OFFLOAD_SUCCESS) {
- DP("Copying data from device failed.\n");
+ REPORT("Copying data from device failed.\n");
return OFFLOAD_FAIL;
}
}
if (AsyncInfo && AsyncInfo->Queue) {
Ret = Device.synchronize(AsyncInfo);
if (Ret != OFFLOAD_SUCCESS) {
- DP("Failed to synchronize device.\n");
+ REPORT("Failed to synchronize device.\n");
return OFFLOAD_FAIL;
}
}
Ret = Device.deallocTgtPtr(Info.HstPtrBegin, Info.DataSize,
Info.ForceDelete, Info.HasCloseModifier);
if (Ret != OFFLOAD_SUCCESS) {
- DP("Deallocating data from device failed.\n");
+ REPORT("Deallocating data from device failed.\n");
return OFFLOAD_FAIL;
}
}
arg_types[i], arg_mappers[i], target_data_update);
if (rc != OFFLOAD_SUCCESS) {
- DP("Call to target_data_update via targetDataMapper for custom mapper"
- " failed.\n");
+ REPORT(
+ "Call to target_data_update via targetDataMapper for custom mapper"
+ " failed.\n");
return OFFLOAD_FAIL;
}
arg_sizes[i], DPxPTR(TgtPtrBegin), DPxPTR(HstPtrBegin));
int rt = Device.retrieveData(HstPtrBegin, TgtPtrBegin, MapSize, nullptr);
if (rt != OFFLOAD_SUCCESS) {
- DP("Copying data from device failed.\n");
+ REPORT("Copying data from device failed.\n");
return OFFLOAD_FAIL;
}
arg_sizes[i], DPxPTR(HstPtrBegin), DPxPTR(TgtPtrBegin));
int rt = Device.submitData(TgtPtrBegin, HstPtrBegin, MapSize, nullptr);
if (rt != OFFLOAD_SUCCESS) {
- DP("Copying data to device failed.\n");
+ REPORT("Copying data to device failed.\n");
return OFFLOAD_FAIL;
}
rt = Device.submitData(it->second.TgtPtrAddr, &it->second.TgtPtrVal,
sizeof(void *), nullptr);
if (rt != OFFLOAD_SUCCESS) {
- DP("Copying data to device failed.\n");
+ REPORT("Copying data to device failed.\n");
Device.ShadowMtx.unlock();
return OFFLOAD_FAIL;
}
int Ret = targetDataBegin(Device, ArgNum, ArgBases, Args, ArgSizes, ArgTypes,
ArgMappers, AsyncInfo);
if (Ret != OFFLOAD_SUCCESS) {
- DP("Call to targetDataBegin failed, abort target.\n");
+ REPORT("Call to targetDataBegin failed, abort target.\n");
return OFFLOAD_FAIL;
}
Ret = Device.submitData(TgtPtrBegin, &PointerTgtPtrBegin,
sizeof(void *), AsyncInfo);
if (Ret != OFFLOAD_SUCCESS) {
- DP("Copying data to device failed.\n");
+ REPORT("Copying data to device failed.\n");
return OFFLOAD_FAIL;
}
}
TgtBaseOffset, IsFirstPrivate,
TgtPtrBegin, TgtArgs.size());
if (Ret != OFFLOAD_SUCCESS) {
- DP("Failed to process %sprivate argument " DPxMOD "\n",
- (IsFirstPrivate ? "first-" : ""), DPxPTR(HstPtrBegin));
+ REPORT("Failed to process %sprivate argument " DPxMOD "\n",
+ (IsFirstPrivate ? "first-" : ""), DPxPTR(HstPtrBegin));
return OFFLOAD_FAIL;
}
} else {
int Ret = targetDataEnd(Device, ArgNum, ArgBases, Args, ArgSizes, ArgTypes,
ArgMappers, AsyncInfo);
if (Ret != OFFLOAD_SUCCESS) {
- DP("Call to targetDataEnd failed, abort targe.\n");
+ REPORT("Call to targetDataEnd failed, abort target.\n");
return OFFLOAD_FAIL;
}
// Free target memory for private arguments
Ret = PrivateArgumentManager.free();
if (Ret != OFFLOAD_SUCCESS) {
- DP("Failed to deallocate target memory for private args\n");
+ REPORT("Failed to deallocate target memory for private args\n");
return OFFLOAD_FAIL;
}
TableMap *TM = getTableMap(HostPtr);
// No map for this host pointer found!
if (!TM) {
- DP("Host ptr " DPxMOD " does not have a matching target pointer.\n",
- DPxPTR(HostPtr));
+ REPORT("Host ptr " DPxMOD " does not have a matching target pointer.\n",
+ DPxPTR(HostPtr));
return OFFLOAD_FAIL;
}
ArgSizes, ArgTypes, ArgMappers, TgtArgs,
TgtOffsets, PrivateArgumentManager, &AsyncInfo);
if (Ret != OFFLOAD_SUCCESS) {
- DP("Failed to process data before launching the kernel.\n");
+ REPORT("Failed to process data before launching the kernel.\n");
return OFFLOAD_FAIL;
}
TgtArgs.size(), &AsyncInfo);
if (Ret != OFFLOAD_SUCCESS) {
- DP("Executing target region abort target.\n");
+ REPORT("Executing target region abort target.\n");
return OFFLOAD_FAIL;
}
ArgTypes, ArgMappers, PrivateArgumentManager,
&AsyncInfo);
if (Ret != OFFLOAD_SUCCESS) {
- DP("Failed to process data after launching the kernel.\n");
+ REPORT("Failed to process data after launching the kernel.\n");
return OFFLOAD_FAIL;
}