/* STARTDEF void bones_kernel__0(int bones_thread_id, int bones_thread_count, int bones_size, , ); void bones_kernel__1(int bones_size, , ); void bones_kernel__2( bones_initial_value, , ); ENDDEF */ // Start of the kernel (main part) void bones_kernel__0(int bones_thread_id, int bones_thread_count, int bones_size, , ) { const int bones_work = DIV_CEIL(bones_size,bones_thread_count); const int bones_global_id = bones_thread_id; int bones_iter_id = ; // Use a thread private memory to perform the per-thread computation(s) bones_temporary = [bones_iter_id]; bones_private_memory = ; for(int c=1; c; if (bones_iter_id <= ) { bones_temporary = [bones_iter_id]; bones_private_memory = ; } } // Store the result [bones_thread_id] = bones_private_memory; } // Start of the kernel (secondary part) void bones_kernel__1(int bones_size, , ) { // Use a private memory to perform the sequential computation(s) bones_private_memory = [0]; for(int bones_iter_id=1; bones_iter_id[bones_iter_id]; } // Store the result [0] = bones_private_memory; } // Start of the kernel (final, initial value kernel) void bones_kernel__2( bones_initial_value, , ) { bones_private_memory = [0]; bones_temporary = bones_initial_value; [0] = ; }