/* Free command queue */ void si_opencl_command_queue_free(struct si_opencl_command_queue_t *command_queue) { /* Check that command list is empty */ if (linked_list_count(command_queue->command_list)) fatal("%s: freed command queue is not empty", __FUNCTION__); /* Free */ si_opencl_repo_remove_object(si_emu->opencl_repo, command_queue); linked_list_free(command_queue->command_list); free(command_queue); }
void si_opencl_kernel_free(struct si_opencl_kernel_t *kernel) { int i; /* Free arguments */ for (i = 0; i < list_count(kernel->arg_list); i++) si_opencl_kernel_arg_free((struct si_opencl_kernel_arg_t *) list_get(kernel->arg_list, i)); list_free(kernel->arg_list); /* AMD Binary (internal ELF) */ if (kernel->bin_file) si_bin_file_free(kernel->bin_file); /* Free lists */ list_free(kernel->constant_buffer_list); /* Free kernel */ si_opencl_repo_remove_object(si_emu->opencl_repo, kernel); free(kernel); }
/* Free device */ void si_opencl_device_free(struct si_opencl_device_t *device) { si_opencl_repo_remove_object(si_emu->opencl_repo, device); free(device); }
void si_opencl_platform_free(struct si_opencl_platform_t *platform) { si_opencl_repo_remove_object(si_emu->opencl_repo, platform); free(platform); }
void si_opencl_event_free(struct si_opencl_event_t *event) { si_opencl_repo_remove_object(si_emu->opencl_repo, event); free(event); }
/* Free sampler */ void si_opencl_sampler_free(struct si_opencl_sampler_t *sampler) { si_opencl_repo_remove_object(si_emu->opencl_repo, sampler); free(sampler); }
/* Free context */ void si_opencl_context_free(struct si_opencl_context_t *context) { si_opencl_repo_remove_object(si_emu->opencl_repo, context); free(context); }