MCPcopy Create free account
hub / github.com/NVIDIA/cutlass / argument

Method argument

python/cutlass_cppgen/backend/frontend.py:48–60  ·  view source on GitHub ↗

Convert the input numpy tensor to CUDA device pointer :param np_tensor: input numpy nd array :param is_output: whether the tensor is output :return: CUDA device pointer

(np_tensor: "np.ndarray", is_output: "bool")

Source from the content-addressed store, hash-verified

46
47 @staticmethod
48 def argument(np_tensor: "np.ndarray", is_output: "bool") -> cuda.CUdeviceptr:
49 """Convert the input numpy tensor to CUDA device pointer
50
51 :param np_tensor: input numpy nd array
52 :param is_output: whether the tensor is output
53
54 :return: CUDA device pointer
55 """
56 # copy the data to device
57 if is_output:
58 return device_mem_alloc(np_tensor.size * np_tensor.itemsize)
59 else:
60 return todevice(np_tensor)
61
62
63class TorchFrontend:

Callers

nothing calls this directly

Calls 2

device_mem_allocFunction · 0.90
todeviceFunction · 0.90

Tested by

no test coverage detected