Skip to content

Commit 211889b

Browse files
committed
clean up and modified memcpy_htod
1 parent dd34b41 commit 211889b

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

kernel_tuner/backends/hip.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,6 @@ def memcpy_dtoh(self, dest, src):
281281
:type src: ctypes ptr
282282
"""
283283
logging.debug("HipFunction memcpy_dtoh called")
284-
print("HipFunction memcpy_dtoh called")
285284

286285
address = dest.ctypes.data
287286
hip.hipMemcpy_dtoh(ctypes.c_void_p(address), src, dest.nbytes)
@@ -296,9 +295,9 @@ def memcpy_htod(self, dest, src):
296295
:type src: numpy.ndarray
297296
"""
298297
logging.debug("HipFunction memcpy_htod called")
299-
print("HipFunction memcpy_htod called")
300-
dtype_str = str(src.dtype)
301-
hip.hipMemcpy_htod(dest, ctypes.byref(src.ctypes), ctypes.sizeof(dtype_map[dtype_str]) * src.size)
298+
299+
address = src.ctypes.data
300+
hip.hipMemcpy_htod(dest, ctypes.c_void_p(address), src.nbytes)
302301

303302
def copy_constant_memory_args(self, cmem_args):
304303
"""adds constant memory arguments to the most recently compiled module
@@ -325,13 +324,13 @@ def copy_constant_memory_args(self, cmem_args):
325324
def copy_shared_memory_args(self, smem_args):
326325
"""add shared memory arguments to the kernel"""
327326
logging.debug("HipFunction copy_shared_memory_args called")
328-
print("HipFunction copy_shared_memory_args called")
327+
329328
self.smem_size = smem_args["size"]
330329

331330
def copy_texture_memory_args(self, texmem_args):
332331
"""This method must implement the allocation and copy of texture memory to the GPU."""
333332
logging.debug("HipFunction copy_texture_memory_args called")
334-
print("HipFunction copy_texture_memory_args called")
335-
raise NotImplementedError("HIP backend does not support texture memory") # NOT SUPPORTED?
333+
334+
raise NotImplementedError("HIP backend does not support texture memory")
336335

337336
units = {"time": "ms"}

0 commit comments

Comments
 (0)