Skip to content

Commit

Permalink
remove cast
Browse files Browse the repository at this point in the history
  • Loading branch information
monofuel committed May 12, 2024
1 parent d005b57 commit bd21f4a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/hippo.nim
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ template hippoMalloc*(size: int): pointer =
## Allocate memory on the GPU and return a pointer to it
var p: pointer
when HippoRuntime == "CUDA":
handleError(cudaMalloc(cast[ptr pointer](addr p), size.cint))
handleError(cudaMalloc(addr p, size.cint))
else:
handleError(hipMalloc(cast[ptr pointer](addr p), size.cint))
handleError(hipMalloc(addr p, size.cint))
p

template hippoMemcpy*(dst: pointer, src: pointer, size: int, kind: HippoMemcpyKind) =
Expand Down Expand Up @@ -159,4 +159,4 @@ template hippoLaunchKernel*(
stream: HippoStream = nil,
args: tuple
) =
handleError(launchKernel(kernel, gridDim, blockDim, sharedMemBytes, stream, args))
handleError(launchKernel(kernel, gridDim, blockDim, sharedMemBytes, stream, args))

0 comments on commit bd21f4a

Please sign in to comment.