-
Adel Ejjeh authoredAdel Ejjeh authored
HPVM-C Language Specification
An HPVM program is a combination of host code and one or more data flow graphs (DFG) at the IR level. We provide C function declarations representing the HPVM intrinsics that allow creating, querying, and interacting with the DFGs. More details about the HPVM IR intrinsics can be found in the HPVM IR Specification..
An HPVM-C program contains both the host and the DFG code. Each HPVM kernel, represented by a leaf node in the DFG, can be compiled to multiple different targets (e.g. CPU and GPU) as described below.
This document describes all the API calls that can be used in an HPVM-C program.
Host API
void __hpvm__init()
Used before all other HPVM calls to initialize the HPVM runtime.
void __hpvm__cleanup()
Used at the end of HPVM program to clean up all remaining runtime-created HPVM objects.
void llvm_hpvm_track_mem(void* ptr, size_t sz)
Insert memory starting at ptr
of size sz
in the memory tracker of HPVM runtime.
void llvm_hpvm_untrack_mem(void* ptr)
Stop tracking the memory object identified by ptr
.
void llvm_hpvm_request_mem(void* ptr, size_t sz)
If the memory object identified by ptr
is not in host memory, copy it to host memory.