iree/hal/local/executable_library_demo.c
static int dispatch_tile_a(
    const iree_hal_executable_dispatch_state_v0_t* dispatch_state,
    const iree_hal_vec3_t* workgroup_id, void* local_memory) {
  const dispatch_tile_a_push_constants_t* push_constants =
      (const dispatch_tile_a_push_constants_t*)dispatch_state->push_constants;
  const float* src = ((const float*)dispatch_state->binding_ptrs[0]);
  float* dst = ((float*)dispatch_state->binding_ptrs[1]);
  dst[workgroup_id->x] = src[workgroup_id->x] + push_constants->f0;
  return 0;
}
// An executable entry point, called one or more times based on the 3D XYZ
// workgroup count specified during the dispatch. Each invocation gets access to
// the dispatch state via |dispatch_state| such as workgroup parameters, push
// constants providing small arguments, and buffer bindings.
//
// See the iree_hal_executable_dispatch_state_v0_t struct for more
// information on the fields here and how they can be used.
//
// WARNING: these functions must not access mutable global state: read-only data
// may be used but as each invocation may be running concurrently with any
// number of other invocations (from any number of user sessions!) all
// communication between invocations must use the buffer bindings for I/O.
//
// This is a simple scalar addition:
//    binding[1] = binding[0] + push_constant[0]
An executable entry point, called one or more times based on the 3D XYZ
workgroup count specified during the dispatch. Each invocation gets access to
the dispatch state via |dispatch_state| such as workgroup parameters, push
constants providing small arguments, and buffer bindings.

See the iree_hal_executable_dispatch_state_v0_t struct for more
information on the fields here and how they can be used.

these functions must not access mutable global state: read-only data
may be used but as each invocation may be running concurrently with any
number of other invocations (from any number of user sessions!) all
communication between invocations must use the buffer bindings for I/O.

This is a simple scalar addition:
binding[1] = binding[0] + push_constant[0]
An executable entry point called one or more times based on the 3D XYZ workgroup count specified during the dispatch . Each invocation gets access to the dispatch state via |dispatch_state| such as workgroup parameters push constants providing small arguments and buffer bindings . See the iree_hal_executable_dispatch_state_v0_t struct for more information on the fields here and how they can be used . these functions must not access mutable global state : read - only data may be used but as each invocation may be running concurrently with any number of other invocations ( from any number of user sessions! ) all communication between invocations must use the buffer bindings for I / O . This is a simple scalar addition : binding [ 1 ] = binding [ 0 ] + push_constant [ 0 ]
static int dispatch_tile_a(
    const iree_hal_executable_dispatch_state_v0_t* dispatch_state,
    const iree_hal_vec3_t* workgroup_id, void* local_memory) {
  const dispatch_tile_a_push_constants_t* push_constants =
      (const dispatch_tile_a_push_constants_t*)dispatch_state->push_constants;
  const float* src = ((const float*)dispatch_state->binding_ptrs[0]);
  float* dst = ((float*)dispatch_state->binding_ptrs[1]);
  dst[workgroup_id->x] = src[workgroup_id->x] + push_constants->f0;
  return 0;
}
static int dispatch_tile_a ( const iree_hal_executable_dispatch_state_v0_t * dispatch_state , const iree_hal_vec3_t * workgroup_id , void * local_memory ) { const dispatch_tile_a_push_constants_t * push_constants = ( const dispatch_tile_a_push_constants_t * ) dispatch_state -> push_constants ; const float * src = ( ( const float * ) dispatch_state -> binding_ptrs [ 0 ] ) ; float * dst = ( ( float * ) dispatch_state -> binding_ptrs [ 1 ] ) ; dst [ workgroup_id -> x ] = src [ workgroup_id -> x ] + push_constants -> f0 ; return 0 ; }
An executable entry point, called one or more times based on the 3D XYZ
workgroup count specified during the dispatch.
An executable entry point called one or more times based on the 3D XYZ workgroup count specified during the dispatch .