Advertisement
Guest User

Untitled

a guest
Apr 19th, 2021
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.04 KB | None | 0 0
  1. __kernel
  2. void relauncher_generic(__global struct lightray* generic_rays_in, __global struct lightray* generic_rays_out,
  3.                         __global struct lightray* finished_rays,
  4.                         __global int* restrict generic_count_in, __global int* restrict generic_count_out,
  5.                         __global int* finished_count_out,
  6.                         int width, int height, int fallback)
  7. {
  8.     ///failed to converge
  9.     if(fallback > 125)
  10.         return;
  11.  
  12.     if((*generic_count_in) == 0)
  13.         return;
  14.  
  15.     if(fallback == 0)
  16.         *finished_count_out = 0;
  17.  
  18.     *generic_count_out = 0;
  19.  
  20.     int generic_count = *generic_count_in;
  21.  
  22.     int loffset = 256;
  23.  
  24.     ///this all used to work fine
  25.     /*clk_event_t f3;
  26.  
  27.     enqueue_kernel(get_default_queue(), CLK_ENQUEUE_FLAGS_NO_WAIT,
  28.                    ndrange_1D(0, generic_count, loffset),
  29.                    0, NULL, &f3,
  30.                    ^{
  31.                         ///running this kernel directly from the host works fine
  32.                         do_generic_rays (generic_rays_in, generic_rays_out,
  33.                                          finished_rays,
  34.                                          generic_count_in, generic_count_out,
  35.                                          finished_count_out);
  36.                    });
  37.  
  38.     enqueue_kernel(get_default_queue(), CLK_ENQUEUE_FLAGS_WAIT_KERNEL,
  39.                    ndrange_1D(0, 1, 1),
  40.                    1, &f3, NULL,
  41.                    ^{
  42.                         relauncher_generic(generic_rays_out, generic_rays_in,
  43.                                            finished_rays,
  44.                                            generic_count_out, generic_count_in,
  45.                                            finished_count_out, width, height, fallback + 1);
  46.                    });
  47.  
  48.     release_event(f3);*/
  49.  
  50.     ///this causes the clGetPipeInfo() crash
  51.     enqueue_kernel(get_default_queue(), CLK_ENQUEUE_FLAGS_NO_WAIT,
  52.                    ndrange_1D(generic_count, loffset),
  53.                    ^{
  54.  
  55.                    });
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement