2121extern "C" {
2222#endif
2323
24- typedef void (* vx_spawn_tasks_cb )(uint32_t task_id , void * arg );
25-
26- typedef void (* vx_serial_cb )(void * arg );
27-
28- void vx_spawn_tasks (uint32_t num_tasks , vx_spawn_tasks_cb callback , const void * arg );
29-
30- void vx_serial (vx_serial_cb callback , const void * arg );
31-
32- ///////////////////////////////////////////////////////////////////////////////
33-
3424typedef union {
3525 struct {
3626 uint32_t x ;
@@ -46,23 +36,28 @@ extern dim3_t gridDim;
4636extern dim3_t blockDim ;
4737
4838extern __thread uint32_t __local_group_id ;
49- extern uint32_t __groups_per_core ;
5039extern uint32_t __warps_per_group ;
5140
5241typedef void (* vx_kernel_func_cb )(void * arg );
5342
43+ typedef void (* vx_serial_cb )(void * arg );
44+
5445#define __local_mem (size ) \
5546 (void*)((int8_t*)csr_read(VX_CSR_LOCAL_MEM_BASE) + __local_group_id * size)
5647
5748#define __syncthreads () \
58- vx_barrier(__COUNTER__ * __groups_per_core + __local_group_id, __warps_per_group)
49+ vx_barrier(__local_group_id, __warps_per_group)
5950
51+ // launch a kernel function with a grid of blocks and block of threads
6052int vx_spawn_threads (uint32_t dimension ,
6153 const uint32_t * grid_dim ,
6254 const uint32_t * block_dim ,
6355 vx_kernel_func_cb kernel_func ,
6456 const void * arg );
6557
58+ // function call serialization
59+ void vx_serial (vx_serial_cb callback , const void * arg );
60+
6661#ifdef __cplusplus
6762}
6863#endif
0 commit comments