summaryrefslogtreecommitdiff
path: root/utests/test_printf.cpp
blob: 84c3fae37e5638e223759ec37bc52998475bcf76 (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
61
62
63
64
65
66
67
68
69
70
71
72
#include "utest_helper.hpp"

void test_printf(void)
{
  // Setup kernel and buffers
  OCL_CREATE_KERNEL("test_printf");
  globals[0] = 16;
  locals[0] = 16;
  globals[1] = 4;
  locals[1] = 4;
  globals[2] = 8;
  locals[2] = 2;

  // Run the kernel on GPU
  OCL_NDRANGE(3);
}

MAKE_UTEST_FROM_FUNCTION(test_printf);

void test_printf_1(void)
{
  // Setup kernel and buffers
  OCL_CREATE_KERNEL_FROM_FILE("test_printf", "test_printf_1");
  globals[0] = 1;
  locals[0] = 1;

  // Run the kernel on GPU
  OCL_NDRANGE(1);
}

MAKE_UTEST_FROM_FUNCTION(test_printf_1);

void test_printf_2(void)
{
  // Setup kernel and buffers
  OCL_CREATE_KERNEL_FROM_FILE("test_printf", "test_printf_2");
  globals[0] = 4;
  locals[0] = 2;

  // Run the kernel on GPU
  OCL_NDRANGE(1);
}

MAKE_UTEST_FROM_FUNCTION(test_printf_2);

void test_printf_3(void)
{
  char c = '@';
  // Setup kernel and buffers
  OCL_CREATE_KERNEL_FROM_FILE("test_printf", "test_printf_3");
  globals[0] = 1;
  locals[0] = 1;
  OCL_SET_ARG(0, sizeof(char), &c);

  // Run the kernel on GPU
  OCL_NDRANGE(1);
}

MAKE_UTEST_FROM_FUNCTION(test_printf_3);

void test_printf_4(void)
{
  // Setup kernel and buffers
  OCL_CREATE_KERNEL_FROM_FILE("test_printf", "test_printf_4");
  globals[0] = 1;
  locals[0] = 1;

  // Run the kernel on GPU
  OCL_NDRANGE(1);
}

MAKE_UTEST_FROM_FUNCTION(test_printf_4);