1 # SPIR Backend
2
3 This backend depends on :
4
5 > A built version of on TornadoVm's SPIRV library being available
6 > [https://github.com/beehive-lab/beehive-spirv-toolkit.git](https://github.com/beehive-lab/beehive-spirv-toolkit.git)
7
8 > The source for the spirv example in the babylon project tree
9 > [https://github.com/openjdk/babylon/tree/code-reflection/cr-examples/spirv](https://github.com/openjdk/babylon/tree/code-reflection/cr-examples/spirv)
10
11 So by default it is commented out in the parent `pom.xml`
12
13 ```
14 <modules>
15 <module>opencl</module>
16 <module>cuda</module>
17 <module>mock</module>
18 <module>ptx</module>
19 <!--<module>spirv</module>-->
20 </modules>
21 ```
22
23 To include SPIRV our maven build assumes you have a project layout matching that described in the projiect roots README.md
24
25 ```
26 /${HOME}/github
27 ├── babylon
28 ├── babylon-my-fork
29 └── ...
30 ```
31
32 And you are either working in '~/github/babylon/hat' or your fork '~/github/babylon-my-fork/hat'
33
34 ### Getting and building TornadoVM's SPIRV library
35 ```
36 export GITHUB=${HOME}/github
37 mkdir -p ${GITHUB}
38 cd ${GITHUB}
39 git clone https://github.com/beehive-lab/beehive-spirv-toolkit.git
40 ```
41
42 So now you have
43
44 ```
45 /${HOME}/github
46 ├── babylon
47 ├── beehive-spirv-toolkit
48 ├── babylon-my-fork
49 └── ...
50 ```
51
52 Assuming you have your babylon (or forked babylon) JDK built and you have already set `${JAVA_HOME}` to point to your built jdk and have `${JAVA_HOME}/bin` in your PATH
53
54 Then you should be able to build `beehive-spirv-toolkit` using maven.
55
56 ```
57 cd ${GITHUB}/
58 GITHUB=${HOME}/github/beehive-spirv-toolkit
59 mvn clean install
60 ```
61
62 The hat maven build process will assume that it will find
63 > ../../beehive-spirv-toolkit
64
65 and
66 > ../../babylon/cr-examples/spirv
67
68 relative to the `hat` dir
69
70 If this is correct you should be able to uncomment out the 'spirv' module in the parent's `pom.xml` and the spirv backend will build as part of a normal hat build.
71
72
73
74