/* FIXME: constant memory should be member of 'frm_emu' or 'grid'? */ void frm_grid_setup_const_mem(struct frm_grid_t *grid) { struct frm_cuda_function_t *function = grid->function; /* FIXME: built-in consts */ frm_isa_const_mem_write(0x8, &function->local_size3[0]); }
void frm_grid_setup_args(struct frm_grid_t *grid) { struct frm_cuda_function_t *function = grid->function; struct frm_cuda_function_arg_t *arg; int i; int offset = 0x20; /* Kernel arguments */ for (i = 0; i < list_count(function->arg_list); i++) { arg = list_get(function->arg_list, i); assert(arg); /* Process argument depending on its type */ if (arg->kind == FRM_CUDA_FUNCTION_ARG_KIND_POINTER) { if (arg->mem_scope == FRM_CUDA_MEM_SCOPE_GLOBAL) { printf("arg->value = 0x%08x\n", arg->value); frm_isa_const_mem_write(offset, &arg->value); offset += 0x4; continue; } else if (arg->mem_scope == FRM_CUDA_MEM_SCOPE_LOCAL) { offset += 0x4; continue; } else fatal("%s: argument in memory scope %d not supported", __FUNCTION__, arg->mem_scope); } else fatal("%s: argument type not recognized", __FUNCTION__); } }
/* FIXME: constant memory should be member of 'frm_emu' or 'grid'? */ void frm_grid_setup_const_mem(struct frm_grid_t *grid) { /* FIXME: built-in consts */ frm_isa_const_mem_write(0x8, &grid->block_size3[0]); }