Home | History | Annotate | Download | only in cl_12
      1 /*
      2  * Copyright 2017 Google Inc.
      3  *
      4  * Use of this source code is governed by a BSD-style license that can
      5  * be found in the LICENSE file.
      6  *
      7  */
      8 
      9 #pragma once
     10 
     11 //
     12 //
     13 //
     14 
     15 #include "block_pool_cl.h"
     16 
     17 //
     18 // FIXME -- define individual structs before defining skc_config
     19 //
     20 
     21 struct skc_config
     22 {
     23   struct {
     24     struct {
     25       skc_uint               size;
     26       skc_uint               subbufs;
     27     } host;   // alignment determined by compiler
     28     struct {
     29       skc_uint               size;
     30       skc_uint               subbufs;
     31     } device; // alignment determined by device
     32   } suballocator;
     33 
     34   struct {
     35     skc_uint                 size;
     36   } scheduler;
     37 
     38   struct {
     39     skc_uint                 bytes;    // bytes per subblock -- pow2
     40     skc_uint                 words;    // words per subblock -- pow2
     41     // skc_uint              words_log2;
     42   } subblock;
     43 
     44   struct {
     45     skc_uint                 bytes;     // bytes per block     -- pow2
     46     skc_uint                 words;     // words per block     -- pow2
     47     skc_uint                 subblocks; // subblocks per block -- block.bytes >= subblock.bytes
     48     // skc_uint              subblocks_log2;
     49   } block;
     50 
     51   union skc_block_pool_size  block_pool;
     52 
     53   struct {
     54     cl_command_queue_properties cq_props;
     55     skc_uint                    size;
     56   } cq_pool;
     57 
     58   struct {
     59     skc_uint                 size;      // a large fraction of block pool size
     60     skc_uint                 width;     // determines number of launched reclamation subgroups
     61     skc_uint                 recs;      // how many in-flight width-subgroup reclamation grids
     62   } handle_pool;
     63 
     64   struct {
     65     skc_uint                 width;     // tile width  in pixels
     66     skc_uint                 height;    // tile height in pixels
     67     skc_uint                 ratio;     // subblocks per TTPB
     68   } tile;
     69 
     70   struct {
     71     struct {
     72       skc_uint               count;     // # of subbufs in buffer
     73     } buffer;
     74 
     75     struct {
     76       skc_uint               count;     // # of blocks/commands in subbuf
     77     } subbuf;
     78 
     79     struct {
     80       size_t                 buffer;    // block.bytes * subbuf.blocks * subbuf.count
     81       size_t                 subbuf;    // block.bytes * subbuf.blocks -- multiple of CL_DEVICE_MEM_BASE_ADDR_ALIGN
     82     } block;
     83 
     84     struct {
     85       size_t                 buffer;    // sizeof(skc_uint) * subbuf.blocks * subbuf.count
     86       size_t                 subbuf;    // sizeof(skc_uint) * subbuf.blocks -- multiple of CL_DEVICE_MEM_BASE_ADDR_ALIGN
     87     } command;
     88     //
     89     // skc_uint              paths_lowat;
     90     //
     91   } paths_copy;
     92 
     93   struct {
     94     struct {
     95       skc_uint               elem_count;
     96       skc_uint               snap_count;
     97     } path_ids;
     98 
     99     struct {
    100       skc_uint               elem_count;
    101       skc_uint               snap_count;
    102     } transforms;
    103 
    104     struct {
    105       skc_uint               elem_count;
    106       skc_uint               snap_count;
    107     } clips;
    108 
    109     struct {
    110       skc_uint               elem_count;
    111       skc_uint               snap_count;
    112     } fill;
    113 
    114     struct {
    115       skc_uint               elem_count;
    116       skc_uint               snap_count;
    117     } raster_ids;
    118 
    119     struct {
    120       skc_uint               cmds;
    121     } expand;
    122 
    123     struct {
    124       skc_uint               keys;
    125     } rasterize;
    126   } raster_cohort;
    127 
    128   struct {
    129     struct {
    130       skc_uint               elem_count;
    131       skc_uint               snap_count;
    132     } cmds;
    133 
    134     struct {
    135       skc_uint               elem_count;
    136     } raster_ids;
    137 
    138     struct {
    139       skc_uint               elem_count;
    140     } keys;
    141   } composition;
    142 };
    143 
    144 //
    145 //
    146 //
    147