Spaces:
Running
on
T4
Running
on
T4
progress
Browse files- tool/sample.txt +4 -1
tool/sample.txt
CHANGED
@@ -2,6 +2,7 @@ Given the following task description:
|
|
2 |
[input.txt]
|
3 |
Write a complete CUDA program (.cu file) that solves this task using a basic and correct algorithm. The implementation should include a kernel function and the main function that tests it.
|
4 |
There are 5 sets of binary input data. The main function should test all five datasets. If all of them pass, the program should print "T", otherwise print "F". The output must strictly be either "T" or "F". Do not write any extra output.
|
|
|
5 |
Here is a reference style for the structure of the .cu file:
|
6 |
```cu
|
7 |
#include <iostream>
|
@@ -113,7 +114,9 @@ int main() {
|
|
113 |
return 0;
|
114 |
}
|
115 |
```
|
116 |
-
You also need to write the Python script gen_test_data.py to generate the test binary files.
|
|
|
|
|
117 |
```py
|
118 |
import numpy as np
|
119 |
import os
|
|
|
2 |
[input.txt]
|
3 |
Write a complete CUDA program (.cu file) that solves this task using a basic and correct algorithm. The implementation should include a kernel function and the main function that tests it.
|
4 |
There are 5 sets of binary input data. The main function should test all five datasets. If all of them pass, the program should print "T", otherwise print "F". The output must strictly be either "T" or "F". Do not write any extra output.
|
5 |
+
When comparing the output of the CUDA program with the reference, you may increase the error tolerance in `compare_scalar()` for numerically unstable or ill-conditioned tasks. For example, tasks such as **matrix inversion** may involve large numerical errors due to floating-point instability, and thus require a larger tolerance threshold.
|
6 |
Here is a reference style for the structure of the .cu file:
|
7 |
```cu
|
8 |
#include <iostream>
|
|
|
114 |
return 0;
|
115 |
}
|
116 |
```
|
117 |
+
You also need to write the Python script gen_test_data.py to generate the test binary files.
|
118 |
+
When generating test data, make sure it is feasible for the target task. For example, in a matrix inversion task, the input matrix must be invertible (i.e., non-singular) to ensure correct reference generation and program behavior.
|
119 |
+
Use the following as a style reference. Make sure all binary files are stored under a folder named data/. Avoid generating extremely large data. Suggested sizes are shown below:
|
120 |
```py
|
121 |
import numpy as np
|
122 |
import os
|