Skip to content

Commit 926bc61

Browse files
committed
changed malloc_shared to malloc_device
1 parent 9226068 commit 926bc61

File tree

1 file changed

+40
-40
lines changed

1 file changed

+40
-40
lines changed

src/sycl-usm/kernel_initialise.cpp

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -230,46 +230,46 @@ void run_kernel_initialise(Chunk *chunk, Settings &settings, int comms_lr_len, i
230230
chunk->ext->device_queue = new queue(selected);
231231
print_and_log(settings, " - SYCL device: %s\n", chunk->ext->device_queue->get_device().get_info<info::device::name>().c_str());
232232

233-
chunk->density0 = sycl::malloc_shared<double>(chunk->x * chunk->y, *chunk->ext->device_queue);
234-
chunk->density = sycl::malloc_shared<double>(chunk->x * chunk->y, *chunk->ext->device_queue);
235-
chunk->energy0 = sycl::malloc_shared<double>(chunk->x * chunk->y, *chunk->ext->device_queue);
236-
chunk->energy = sycl::malloc_shared<double>(chunk->x * chunk->y, *chunk->ext->device_queue);
237-
chunk->u = sycl::malloc_shared<double>(chunk->x * chunk->y, *chunk->ext->device_queue);
238-
chunk->u0 = sycl::malloc_shared<double>(chunk->x * chunk->y, *chunk->ext->device_queue);
239-
chunk->p = sycl::malloc_shared<double>(chunk->x * chunk->y, *chunk->ext->device_queue);
240-
chunk->r = sycl::malloc_shared<double>(chunk->x * chunk->y, *chunk->ext->device_queue);
241-
chunk->mi = sycl::malloc_shared<double>(chunk->x * chunk->y, *chunk->ext->device_queue);
242-
chunk->w = sycl::malloc_shared<double>(chunk->x * chunk->y, *chunk->ext->device_queue);
243-
chunk->kx = sycl::malloc_shared<double>(chunk->x * chunk->y, *chunk->ext->device_queue);
244-
chunk->ky = sycl::malloc_shared<double>(chunk->x * chunk->y, *chunk->ext->device_queue);
245-
chunk->sd = sycl::malloc_shared<double>(chunk->x * chunk->y, *chunk->ext->device_queue);
246-
chunk->volume = sycl::malloc_shared<double>(chunk->x * chunk->y, *chunk->ext->device_queue);
247-
chunk->x_area = sycl::malloc_shared<double>((chunk->x + 1) * chunk->y, *chunk->ext->device_queue);
248-
chunk->y_area = sycl::malloc_shared<double>(chunk->x * (chunk->y + 1), *chunk->ext->device_queue);
249-
chunk->cell_x = sycl::malloc_shared<double>(chunk->x, *chunk->ext->device_queue);
250-
chunk->cell_y = sycl::malloc_shared<double>(chunk->y, *chunk->ext->device_queue);
251-
chunk->cell_dx = sycl::malloc_shared<double>(chunk->x, *chunk->ext->device_queue);
252-
chunk->cell_dy = sycl::malloc_shared<double>(chunk->y, *chunk->ext->device_queue);
253-
chunk->vertex_dx = sycl::malloc_shared<double>((chunk->x + 1), *chunk->ext->device_queue);
254-
chunk->vertex_dy = sycl::malloc_shared<double>((chunk->y + 1), *chunk->ext->device_queue);
255-
chunk->vertex_x = sycl::malloc_shared<double>((chunk->x + 1), *chunk->ext->device_queue);
256-
chunk->vertex_y = sycl::malloc_shared<double>((chunk->y + 1), *chunk->ext->device_queue);
257-
258-
chunk->left_send = sycl::malloc_shared<double>(comms_lr_len, *chunk->ext->device_queue);
259-
chunk->left_recv = sycl::malloc_shared<double>(comms_lr_len, *chunk->ext->device_queue);
260-
chunk->right_send = sycl::malloc_shared<double>(comms_lr_len, *chunk->ext->device_queue);
261-
chunk->right_recv = sycl::malloc_shared<double>(comms_lr_len, *chunk->ext->device_queue);
262-
chunk->top_send = sycl::malloc_shared<double>(comms_tb_len, *chunk->ext->device_queue);
263-
chunk->top_recv = sycl::malloc_shared<double>(comms_tb_len, *chunk->ext->device_queue);
264-
chunk->bottom_send = sycl::malloc_shared<double>(comms_tb_len, *chunk->ext->device_queue);
265-
chunk->bottom_recv = sycl::malloc_shared<double>(comms_tb_len, *chunk->ext->device_queue);
266-
267-
chunk->ext->reduction_cg_rro = sycl::malloc_shared<double>(1, *chunk->ext->device_queue);
268-
chunk->ext->reduction_cg_pw = sycl::malloc_shared<double>(1, *chunk->ext->device_queue);
269-
chunk->ext->reduction_cg_rrn = sycl::malloc_shared<double>(1, *chunk->ext->device_queue);
270-
chunk->ext->reduction_jacobi_error = sycl::malloc_shared<double>(1, *chunk->ext->device_queue);
271-
chunk->ext->reduction_norm = sycl::malloc_shared<double>(1, *chunk->ext->device_queue);
272-
chunk->ext->reduction_field_summary = sycl::malloc_shared<Summary>(1, *chunk->ext->device_queue);
233+
chunk->density0 = sycl::malloc_device<double>(chunk->x * chunk->y, *chunk->ext->device_queue);
234+
chunk->density = sycl::malloc_device<double>(chunk->x * chunk->y, *chunk->ext->device_queue);
235+
chunk->energy0 = sycl::malloc_device<double>(chunk->x * chunk->y, *chunk->ext->device_queue);
236+
chunk->energy = sycl::malloc_device<double>(chunk->x * chunk->y, *chunk->ext->device_queue);
237+
chunk->u = sycl::malloc_device<double>(chunk->x * chunk->y, *chunk->ext->device_queue);
238+
chunk->u0 = sycl::malloc_device<double>(chunk->x * chunk->y, *chunk->ext->device_queue);
239+
chunk->p = sycl::malloc_device<double>(chunk->x * chunk->y, *chunk->ext->device_queue);
240+
chunk->r = sycl::malloc_device<double>(chunk->x * chunk->y, *chunk->ext->device_queue);
241+
chunk->mi = sycl::malloc_device<double>(chunk->x * chunk->y, *chunk->ext->device_queue);
242+
chunk->w = sycl::malloc_device<double>(chunk->x * chunk->y, *chunk->ext->device_queue);
243+
chunk->kx = sycl::malloc_device<double>(chunk->x * chunk->y, *chunk->ext->device_queue);
244+
chunk->ky = sycl::malloc_device<double>(chunk->x * chunk->y, *chunk->ext->device_queue);
245+
chunk->sd = sycl::malloc_device<double>(chunk->x * chunk->y, *chunk->ext->device_queue);
246+
chunk->volume = sycl::malloc_device<double>(chunk->x * chunk->y, *chunk->ext->device_queue);
247+
chunk->x_area = sycl::malloc_device<double>((chunk->x + 1) * chunk->y, *chunk->ext->device_queue);
248+
chunk->y_area = sycl::malloc_device<double>(chunk->x * (chunk->y + 1), *chunk->ext->device_queue);
249+
chunk->cell_x = sycl::malloc_device<double>(chunk->x, *chunk->ext->device_queue);
250+
chunk->cell_y = sycl::malloc_device<double>(chunk->y, *chunk->ext->device_queue);
251+
chunk->cell_dx = sycl::malloc_device<double>(chunk->x, *chunk->ext->device_queue);
252+
chunk->cell_dy = sycl::malloc_device<double>(chunk->y, *chunk->ext->device_queue);
253+
chunk->vertex_dx = sycl::malloc_device<double>((chunk->x + 1), *chunk->ext->device_queue);
254+
chunk->vertex_dy = sycl::malloc_device<double>((chunk->y + 1), *chunk->ext->device_queue);
255+
chunk->vertex_x = sycl::malloc_device<double>((chunk->x + 1), *chunk->ext->device_queue);
256+
chunk->vertex_y = sycl::malloc_device<double>((chunk->y + 1), *chunk->ext->device_queue);
257+
258+
chunk->left_send = sycl::malloc_device<double>(comms_lr_len, *chunk->ext->device_queue);
259+
chunk->left_recv = sycl::malloc_device<double>(comms_lr_len, *chunk->ext->device_queue);
260+
chunk->right_send = sycl::malloc_device<double>(comms_lr_len, *chunk->ext->device_queue);
261+
chunk->right_recv = sycl::malloc_device<double>(comms_lr_len, *chunk->ext->device_queue);
262+
chunk->top_send = sycl::malloc_device<double>(comms_tb_len, *chunk->ext->device_queue);
263+
chunk->top_recv = sycl::malloc_device<double>(comms_tb_len, *chunk->ext->device_queue);
264+
chunk->bottom_send = sycl::malloc_device<double>(comms_tb_len, *chunk->ext->device_queue);
265+
chunk->bottom_recv = sycl::malloc_device<double>(comms_tb_len, *chunk->ext->device_queue);
266+
267+
chunk->ext->reduction_cg_rro = sycl::malloc_device<double>(1, *chunk->ext->device_queue);
268+
chunk->ext->reduction_cg_pw = sycl::malloc_device<double>(1, *chunk->ext->device_queue);
269+
chunk->ext->reduction_cg_rrn = sycl::malloc_device<double>(1, *chunk->ext->device_queue);
270+
chunk->ext->reduction_jacobi_error = sycl::malloc_device<double>(1, *chunk->ext->device_queue);
271+
chunk->ext->reduction_norm = sycl::malloc_device<double>(1, *chunk->ext->device_queue);
272+
chunk->ext->reduction_field_summary = sycl::malloc_device<Summary>(1, *chunk->ext->device_queue);
273273

274274
allocate_buffer(&(chunk->cg_alphas), settings.max_iters, 1);
275275
allocate_buffer(&(chunk->cg_betas), settings.max_iters, 1);

0 commit comments

Comments
 (0)