aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/compute/skc/block_pool_cl.h
blob: c88370919ec061e79c00d9a5f9f8ebe5dc2ae271 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*
 * Copyright 2017 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can
 * be found in the LICENSE file.
 *
 */

#ifndef SKC_ONCE_BLOCK_POOL
#define SKC_ONCE_BLOCK_POOL

//
//
//

#include "types.h"

//
//
//

union skc_block_pool_size
{
  skc_uint3   u32v3;

  struct {
    skc_uint  pool_size; // number of blocks
    skc_uint  ring_pow2; // rounded-up pow2 of pool_size
    skc_uint  ring_mask; // ring_pow2 - 1
  };
};

//
//
//

union skc_block_pool_atomic
{
  skc_uint2  u32v2;

  skc_uint   u32a2[2];

  struct {
    skc_uint reads;
    skc_uint writes;
  };
};

#define SKC_BP_ATOMIC_OFFSET_READS   0
#define SKC_BP_ATOMIC_OFFSET_WRITES  1

//
//
//

#endif

//
//
//