1
2 # HAT Testing Framework
3 [Back to Index ../](../index.md)
4
5
6 ## Local Testing
7
8 For the OpenCL backend:
9
10 ```bash
11 java @.ffi-opencl-test-suite
12 ```
13
14 For the CUDA backend:
15
16 ```bash
17 java @.ffi-cuda-test-suite
18 ```
19
20 ## Individual tests
21
22 ```bash
23 java @.ffi-cuda-test CLASS#method
24 ```
25
26 Passing a particular method to test is optional.
27
28 For example, to test the whole `TestArrays` class:
29
30 ```bash
31 java @.ffi-cuda-test hat.test.TestArrays
32
33 HAT Engine Testing Framework
34 Testing Backend: hat.backend.ffi.OpenCLBackend
35
36 Class: hat.test.TestArrays
37 Testing: #testHelloHat ..................... [ok]
38 Testing: #testVectorAddition ..................... [ok]
39 Testing: #testVectorSaxpy ..................... [ok]
40 Testing: #testSmallGrid ..................... [ok]
41
42 passed: 4, failed: 0, unsupported: 0
43 ```
44
45 To test a single method (e.g., `testVectorAddition`):
46
47
48 ```bash
49 java @.ffi-cuda-test hat.test.TestArrays#testVectorAddition
50
51 HAT Engine Testing Framework
52 Testing Backend: hat.backend.ffi.OpenCLBackend
53
54 Class: hat.test.TestArrays
55 Testing: #testVectorAddition ..................... [ok]
56
57 passed: 1, failed: 0, unsupported: 0
58 ```
59
60 ## Remote Testing
61
62 HAT provides its own testing framework that can be used to test on remote GPU servers.
63 First, you need to generate and configure the template:
64
65 ```bash
66 bash scripts/remoteTesting.sh --generate-config-file
67 ```
68
69 This flag generates a file in the local directory called `remoteTesting.conf`.
70 We just need to fill the template with the server names, and user names, fork to use, backends to test and the branch to use.
71
72 For instance:
73
74 ```bash
75 # HAT Remote Testing Settings
76 SERVERS=server1 server2
77 REMOTE_USERS=juan juan
78 FORK=git@github.com:my-fork/babylon.git
79
80 #List of Backends to test
81 BACKENDS=ffi-cuda ffi-opencl
82
83 ## Remote path. It assumes all servers use the same path
84 REMOTE_PATH=repos/babylon
85 ## Branch to test
86 BRANCH=code-reflection
87 ```
88
89 This assumes you have the `ssh-keygen` already configured.
90
91 Then, we need to build the project Babylon:
92
93 ```bash
94 bash scripts/remoteTesting.sh --build-babylon
95 ```
96
97 This builds babylon for each of the servers specified. The project is stored in the path specified in `REMOTE_PATH`.
98
99 Once it is finished, you can run the unit-tests on the remote GPU servers as follows:
100
101 ```bash
102 bash scripts/remoteTesting.sh
103 ```