aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/compute/skc/make_inl_cl.bat
blob: 777a5f3bc2a0cb21a370d2400fc388fef1858073 (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
@ECHO OFF

SET OPENCL_STD=-cl-std=CL1.2
SET OPENCL_PRE=__OPENCL_C_VERSION__=120

:: OPENCL_STD=-cl-std=CL2.0
:: OPENCL_PRE=__OPENCL_C_VERSION__=200

::
::
::

SET IOC=ioc64

::
::
::

SET IOC_IR_OPTS_OPT=%OPENCL_STD% -cl-single-precision-constant -cl-denorms-are-zero -cl-mad-enable -cl-no-signed-zeros -cl-fast-relaxed-math -cl-kernel-arg-info

SET IOC_IR_OPTS_DBG=%OPENCL_STD% -cl-kernel-arg-info -g

SET IOC_IR_OPTS=%IOC_IR_OPTS_OPT%

::
::
::

SET PRE_DIR=%~p1

CD %PRE_DIR%

SET PRE_CL=%~n1
SET PRE_CL=%PRE_CL%.pre.cl

SET PRE_SRC_INL=%~n1
SET PRE_SRC_INL=%PRE_SRC_INL%.pre.src.inl

SET PRE_BIN_IR=%~n1
SET PRE_BIN_IR=%PRE_BIN_IR%.pre.ir

SET PRE_BIN_INL=%~n1
SET PRE_BIN_INL=%PRE_BIN_INL%.pre.bin.inl

::
:: *.pre.cl
:: *.pre.src.inl
::

CMD /C cl -I . -I .. -I "%INTELOCLSDKROOT%\include" -D %OPENCL_PRE% -EP %1 -P -Fi"%PRE_CL%"
CMD /C clang-format -style=Mozilla -i %PRE_CL%
CMD /C dos2unix -q %PRE_CL%
CMD /C xxd -i %PRE_CL% %PRE_SRC_INL%

echo %PRE_CL%
echo %PRE_SRC_INL%

::
:: *.pre.cl
:: *.pre.src.inl
::

CMD /C touch %PRE_BIN_IR%
ECHO ON
@CMD /C %IOC% -cmd=build -bo="%IOC_IR_OPTS%" -device=gpu -input=%PRE_CL% -ir=%PRE_BIN_IR%
@ECHO OFF
CMD /C xxd -i %PRE_BIN_IR% %PRE_BIN_INL%

echo %PRE_BIN_IR%
echo %PRE_BIN_INL%