forked from OSchip/llvm-project
mcuMemHostRegister: take into account sizeof(float)
cuMemHostRegister expects the size of registered memory in bytes whereas the memref descriptor in memref_t contains the number of elements. Get the actual size in bytes instead. PiperOrigin-RevId: 257589116
This commit is contained in:
parent
801efec9e6
commit
7ef559e0f2
|
@ -89,8 +89,9 @@ struct memref_t {
|
|||
// Allows to register a pointer with the CUDA runtime. Helpful until
|
||||
// we have transfer functions implemented.
|
||||
extern "C" void mcuMemHostRegister(const memref_t arg, int32_t flags) {
|
||||
reportErrorIfAny(cuMemHostRegister(arg.values, arg.length, flags),
|
||||
"MemHostRegister");
|
||||
reportErrorIfAny(
|
||||
cuMemHostRegister(arg.values, arg.length * sizeof(float), flags),
|
||||
"MemHostRegister");
|
||||
}
|
||||
|
||||
/// Prints the given float array to stderr.
|
||||
|
|
Loading…
Reference in New Issue