remove logging

This commit is contained in:
Hendrik Groove
2024-10-21 21:52:34 +02:00
parent 9659d0e7bd
commit 20a9c223b6
5 changed files with 1 additions and 111 deletions

View File

@@ -62,50 +62,35 @@ void ArrayInterfaceHandler::SyncCudaStream(std::int64_t stream) {
}
bool ArrayInterfaceHandler::IsCudaPtr(void const* ptr) {
std::cerr << "Entering IsCudaPtr with ptr: " << ptr << std::endl;
if (!ptr) {
std::cerr << "Pointer is null, returning false" << std::endl;
return false;
}
// Check if the pointer is within the process's address space
uintptr_t ptr_value = reinterpret_cast<uintptr_t>(ptr);
uintptr_t process_max_addr = (uintptr_t)-1;
std::cerr << "Pointer value: " << ptr_value << ", Max address: " << process_max_addr << std::endl;
#if defined(XGBOOST_USE_HIP)
hipPointerAttribute_t attr;
std::cerr << "Calling hipPointerGetAttributes" << std::endl;
auto err = hipPointerGetAttributes(&attr, ptr);
std::cerr << "hipPointerGetAttributes returned: " << hipGetErrorString(err) << std::endl;
if (err == hipErrorInvalidValue) {
std::cerr << "Invalid pointer (hipErrorInvalidValue), returning false" << std::endl;
return false;
} else if (err == hipSuccess) {
std::cerr << "Pointer attributes obtained successfully" << std::endl;
std::cerr << "Memory type: " << attr.type << std::endl;
switch (attr.type) {
case hipMemoryTypeUnregistered:
std::cerr << "Memory type is Unregistered, returning false" << std::endl;
return false;
case hipMemoryTypeHost:
std::cerr << "Memory type is Host, returning false" << std::endl;
return false;
case hipMemoryTypeDevice:
std::cerr << "Memory type is Device, returning true" << std::endl;
return true;
case hipMemoryTypeManaged:
std::cerr << "Memory type is Managed, returning true" << std::endl;
return true;
default:
std::cerr << "Unknown memory type: " << attr.type << std::endl;
return false;
}
} else {
std::cerr << "hipPointerGetAttributes failed with error: "
<< hipGetErrorString(err) << std::endl;
return false;
}
#elif defined(XGBOOST_USE_CUDA)