monofuel / hippo

HIP / CUDA library for Nim
MIT License
45 stars 1 forks source link

Hippo

A Julia Set fractal generated with HIP

Minimal HIP Example

import hippo

proc addKernel*(a, b: cint; c: ptr[cint]) {.hippoGlobal.} =
  c[] = a + b

var
  c: int32
  dev_c = hippoMalloc(sizeof(int32))
hippoLaunchKernel(addKernel,args = (2,7,dev_c.p))
hippoMemcpy(addr c, dev_c, sizeof(int32), hipMemcpyDeviceToHost)
echo "2 + 7 = ", c

Functions

Pragmas

basic kernel example:

proc add(a,b: int; c: ptr[int]): {.hippoGlobal.} =
  c[] = a + b

Notes

Motivation

Compiling

Required flags for HIP

Optional flags

Testing

Feature todo list

Stretch goals