API Reference
Core Types
-
enum VcDtype
Column data type enumeration. Represents the element type of a GPU column buffer.
-
enumerator VC_DTYPE_U8 = 0
-
enumerator VC_DTYPE_U16 = 1
-
enumerator VC_DTYPE_U32 = 2
-
enumerator VC_DTYPE_U64 = 3
-
enumerator VC_DTYPE_I8 = 4
-
enumerator VC_DTYPE_I16 = 5
-
enumerator VC_DTYPE_I32 = 6
-
enumerator VC_DTYPE_I64 = 7
-
enumerator VC_DTYPE_F32 = 8
-
enumerator VC_DTYPE_F64 = 9
-
enumerator VC_DTYPE_U8 = 0
-
type VcContext
Opaque handle to a GPU context. Created by
vc_create_context()and destroyed byvc_destroy_context(). Manages Vulkan instance, physical device, logical device, queue, command pool, and VMA allocator.
-
type VcColumn
Opaque handle to a typed column buffer on the GPU. Created by
vc_create_column()and destroyed byvc_destroy_column(). Internal layout is not part of the public ABI.
Context Lifecycle
Column Management
-
VcColumn *vc_create_column(VcContext *ctx, VcDtype dtype, uint64_t length, const void *host_data)
Allocate a typed column on the GPU and optionally upload host data.
- Parameters:
ctx – GPU context.
dtype – Element data type.
length – Number of elements.
host_data – Pointer to host data to upload, or
NULLto leave uninitialized.
- Returns:
A new column, or
NULLon failure.- Return type:
VcColumn*
-
void vc_destroy_column(VcContext *ctx, VcColumn *col)
Free a GPU column and its backing buffer. Passing
NULLfor either argument is a no-op.
-
int vc_read_column(VcContext *ctx, VcColumn *col, void *host_buffer, uint64_t host_buffer_size)
Read column data back from GPU to host memory. Uses a staging buffer and pipeline barriers to ensure correct synchronization.
- Parameters:
ctx – GPU context.
col – Column to read.
host_buffer – Destination buffer on the host.
host_buffer_size – Size of the destination buffer in bytes.
- Returns:
0on success, non-zero on error (e.g., buffer too small).
Operations
-
VcColumn *vc_filter(VcContext *ctx, VcColumn *data_col, VcColumn *mask_col, uint64_t *out_length)
Filter a column by a boolean mask (stream compaction). Returns a new column containing only elements where the mask is non-zero.
Status: Stub — returns
NULL. Stream compaction implementation planned for Phase 2.