-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move new translator to translator-v2, restore old translator
- Loading branch information
Showing
106 changed files
with
29,714 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
### C/C++ Code Generators | ||
This directory contains the OP2 code generators written in python targetting the C/C++ API. The parallelisations and optimisations supported by each generator are as follows: | ||
* `op2_gen_seq.py` | ||
* `op2_gen_openmp.py`: Initial OpenMP code generator. | ||
* `op2_gen_openmp_simple.py`: Simplified and Optimized OpenMP code generator. | ||
* `op2_gen_cuda.py`: Optimized for Fermi GPUs. | ||
* `op2_gen_cuda_simple`: Optimized for Kepler GPUs. | ||
* `op2_gen_cuda_simple_hyb.py`: Generates OpenMP code as well as CUDA code into the same file. Both CPUs and GPUs will then be used to do computations as a hybrid application. | ||
|
||
#### Invoking the Code Generator | ||
Uncomment the parallelization you want to code generate in `op2.py`. For example for CUDA code generation do: | ||
``` | ||
#op2_gen_seq(str(sys.argv[1]), date, consts, kernels) | ||
#op2_gen_openmp(str(sys.argv[1]), date, consts, kernels) # Initial OpenMP code generator | ||
op2_gen_cuda(str(sys.argv[1]), date, consts, kernels,sets) # Optimized for Fermi GPUs | ||
``` | ||
|
||
Make `op2.py` executable | ||
``` | ||
chmod a+x ./op2.py | ||
``` | ||
|
||
Invoke the code generator by supplying the files that contain op_* API calls. Thus for example for Airfoil do the following. | ||
``` | ||
./op2.py airfoil.cpp | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/bash | ||
#Uses clang-format to format code to conform to the OP2 coding guidelines | ||
# ... currently only applies to files within the current directory | ||
# also only format the files producded by the code generator (i.e. files with kernel in their name) | ||
|
||
#for file in ./*.cu ./*.cpp ./*.h ./*.hpp; do clang-format "$file" > "$file"_temp; mv "$file"_temp "$file"; done | ||
|
||
ls ./*kernel* 2> /dev/null | ||
if [ $? -eq 0 ] | ||
then | ||
for file in ./*kernel*; do clang-format -i "$file"; done | ||
fi | ||
ls ./*_op.cpp 2> /dev/null | ||
if [ $? -eq 0 ] | ||
then | ||
for file in ./*_op.cpp; do clang-format -i "$file"; done | ||
fi | ||
|
||
#ls ./*.cu 2> /dev/null | ||
#if [ $? -eq 0 ] | ||
#then | ||
# for file in ./*.cu; do clang-format -i "$file"; done | ||
#fi | ||
#ls ./*.c 2> /dev/null | ||
#if [ $? -eq 0 ] | ||
#then | ||
# for file in ./*.c ; do clang-format -i "$file"; done | ||
#fi | ||
#ls ./*.cpp 2> /dev/null | ||
#if [ $? -eq 0 ] | ||
#then | ||
# for file in ./*.cpp ; do clang-format -i "$file"; done | ||
#fi | ||
#ls ./*.h 2> /dev/null | ||
#if [ $? -eq 0 ] | ||
#then | ||
# for file in ./*.h ; do clang-format -i "$file"; done | ||
#fi | ||
#ls ./*.hpp 2> /dev/null | ||
#if [ $? -eq 0 ] | ||
#then | ||
# for file in ./*.hpp ; do clang-format -i "$file"; done | ||
#fi |
Oops, something went wrong.