Method usingPtr
val usingPtr: CUdeviceptr -> SizeT -> TensorLayout -> Tensor<'T>
Creates a tensor from the given CUDA pointer, allocation size in bytes and layout.
Declaration
val usingPtr: ptr:CUdeviceptr -> sizeInBytes:SizeT -> layout:TensorLayout -> Tensor<'T>
Parameters
Type | Name | Description |
---|---|---|
ManagedCuda.BasicTypes.CUdeviceptr | ptr | A CUDA device pointer. |
ManagedCuda.BasicTypes.SizeT | sizeInBytes | Size of the allocation referenced by |
TensorLayout | layout | Layout of the tensor. |
Returns
Type | Description |
---|---|
Tensor<'T> |
Type Parameters
Name | Description |
---|---|
'T | Type of contained data. |
Remarks
This function creates a tensor using existing data in GPU memory.
The data is referenced. Thus changing values within the tensor affects the original data.