Commit 065d1178 authored by Robert Maynard's avatar Robert Maynard

Testing Device Adapter now uses ArrayHandle for all device transfers

The consistent API for control to execution memory transfers is
the ArrayHandle class. Previously the tests would verify memory
transfer by calling the ArrayManagerExecution class directly. This
is problematic as the class isn't used by ArrayHandle<T, StorageBasic>.
parent 33a30299
......@@ -51,6 +51,19 @@ void ExecutionArrayInterfaceBasic<DeviceAdapterTagCuda>::Allocate(TypelessExecut
}
}
const std::size_t maxNumVals = (std::numeric_limits<std::size_t>::max() / sizeOfValue);
if (static_cast<std::size_t>(numberOfValues) > maxNumVals)
{
VTKM_LOG_F(vtkm::cont::LogLevel::MemExec,
"Refusing to allocate CUDA memory; number of values (%llu) exceeds "
"std::size_t capacity.",
static_cast<vtkm::UInt64>(numberOfValues));
std::ostringstream err;
err << "Failed to allocate " << numberOfValues << " values on device: "
<< "Number of bytes is not representable by std::size_t.";
throw vtkm::cont::ErrorBadAllocation(err.str());
}
if (execArray.Array != nullptr)
{
const vtkm::UInt64 cap = static_cast<vtkm::UInt64>(static_cast<char*>(execArray.ArrayCapacity) -
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment