[hsa] Cleanups only, no functionality changes intended.
@@ -848,8 +848,8 @@ pocl_hsa_alloc_mem_obj(cl_device_id device, cl_mem mem_obj, void* host_ptr)
cl_mem_flags flags = mem_obj->flags;
unsigned i;
- /* check if some driver has already allocated memory for this mem_obj
- in our global address space, and use that*/
+ /* Check if some driver has already allocated memory for this mem_obj
+ in our global address space, and use that. */
for (i = 0; i < mem_obj->context->num_devices; ++i)
{
if (!mem_obj->device_ptrs[i].available)
@@ -868,12 +868,12 @@ pocl_hsa_alloc_mem_obj(cl_device_id device, cl_mem mem_obj, void* host_ptr)
}
}
- /* memory for this global memory is not yet allocated -> do it */
+ /* Memory for this global memory is not yet allocated -> we'll allocate it. */
b = pocl_hsa_malloc (device, flags, mem_obj->size, host_ptr);
if (b == NULL)
return CL_MEM_OBJECT_ALLOCATION_FAILURE;
- /* take ownership if not USE_HOST_PTR */
+ /* Take ownership if not USE_HOST_PTR. */
if (~flags & CL_MEM_USE_HOST_PTR)
mem_obj->shared_mem_allocation_owner = device;
@@ -957,21 +957,6 @@ setup_kernel_args (pocl_hsa_device_data_t *d,
memcpy (write_pos, &temp, sizeof(uint64_t));
}
write_pos += sizeof(uint64_t);
-#if 0
- /* TODO: It's legal to pass a NULL pointer to clSetKernelArguments.
- In that case we must pass the same NULL forward to the kernel.
- Otherwise, the user must have created a buffer with per device
- pointers stored in the cl_mem. */
- if (al->value == NULL)
- {
- arguments[i] = malloc (sizeof (void *));
- *(void **)arguments[i] = NULL;
- }
- else
- arguments[i] =
- &((*(cl_mem *) (al->value))->device_ptrs[cmd->device->dev_id]
- .mem_ptr);
-#endif
}
else if (cmd->command.run.kernel->arg_info[i].type
== POCL_ARG_TYPE_IMAGE)
