fix
This commit is contained in:
parent
1f4154d756
commit
ed1636b9c0
@ -996,19 +996,20 @@ auto Reduce(Policy policy, InputIt first, InputIt second, Init init, Func reduce
|
|||||||
std::cerr << "Processing batch: offset=" << offset << ", batch_size=" << batch_size << std::endl;
|
std::cerr << "Processing batch: offset=" << offset << ", batch_size=" << batch_size << std::endl;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Get the raw pointers for debugging
|
// Instead of trying to get raw pointers, let's print the iterator types
|
||||||
auto raw_begin = thrust::raw_pointer_cast(&*begin_it);
|
std::cerr << "Iterator types - begin: " << typeid(begin_it).name()
|
||||||
auto raw_end = thrust::raw_pointer_cast(&*end_it);
|
<< ", end: " << typeid(end_it).name() << std::endl;
|
||||||
std::cerr << "Raw pointers - begin: " << (const void*)raw_begin
|
|
||||||
<< ", end: " << (const void*)raw_end << std::endl;
|
|
||||||
|
|
||||||
// Check if the pointers are valid device pointers
|
// If we need to check pointer validity, we can do it like this:
|
||||||
hipPointerAttribute_t attrs;
|
if (batch_size > 0) {
|
||||||
hipError_t ptr_err = hipPointerGetAttributes(&attrs, raw_begin);
|
auto& first_element = *begin_it;
|
||||||
if (ptr_err != hipSuccess) {
|
hipPointerAttribute_t attrs;
|
||||||
std::cerr << "Invalid begin pointer: " << hipGetErrorString(ptr_err) << std::endl;
|
hipError_t ptr_err = hipPointerGetAttributes(&attrs, &first_element);
|
||||||
} else {
|
if (ptr_err != hipSuccess) {
|
||||||
std::cerr << "Valid begin pointer, memory type: " << attrs.type << std::endl;
|
std::cerr << "Invalid pointer for first element: " << hipGetErrorString(ptr_err) << std::endl;
|
||||||
|
} else {
|
||||||
|
std::cerr << "Valid pointer for first element, memory type: " << attrs.type << std::endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto ret = thrust::reduce(policy, begin_it, end_it, init, reduce_op);
|
auto ret = thrust::reduce(policy, begin_it, end_it, init, reduce_op);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user