First Commit
This commit is contained in:
117
compile.sh
Normal file
117
compile.sh
Normal file
@@ -0,0 +1,117 @@
|
||||
|
||||
|
||||
emcc ./wasm_add.c \
|
||||
-Os \
|
||||
-s STANDALONE_WASM=1 \
|
||||
-s EXPORTED_FUNCTIONS='["_alloc", "_dealloc", "_alloc_float_array", "_dealloc_float_array", "_init_arrays", "_calculate"]' \
|
||||
--no-entry \
|
||||
-s INITIAL_MEMORY=180224000 \
|
||||
-s ALLOW_MEMORY_GROWTH=1 \
|
||||
-o ./binaries/wasm_add.wasm
|
||||
|
||||
emcc ./wasm_add_pthread.c \
|
||||
-Os \
|
||||
-s STANDALONE_WASM=1 \
|
||||
-s EXPORTED_FUNCTIONS='["_alloc", "_dealloc", "_alloc_float_array", "_dealloc_float_array", "_init_arrays_range", "_calculate_range"]' \
|
||||
--no-entry \
|
||||
-s INITIAL_MEMORY=180224000 \
|
||||
-s ALLOW_MEMORY_GROWTH=1 \
|
||||
-o ./binaries/wasm_add_pthread.wasm
|
||||
|
||||
emcc wasm_pthread_fast/wasm_add_pthread.c \
|
||||
-O3 \
|
||||
-s USE_PTHREADS=1 \
|
||||
-s PTHREAD_POOL_SIZE=8 \
|
||||
-s ALLOW_MEMORY_GROWTH=0 \
|
||||
-s INITIAL_MEMORY=256MB \
|
||||
-s EXPORTED_FUNCTIONS='["_alloc_float_array","_dealloc_float_array","_init_arrays","_calculate_range"]' \
|
||||
-s EXPORTED_RUNTIME_METHODS='["ccall","cwrap","wasmMemory"]' \
|
||||
--no-entry \
|
||||
-o ./wasm_pthread_fast/binaries/wasm_add_pthread.js \
|
||||
-s EXPORT_ES6=1 \
|
||||
-s MODULARIZE=1 \
|
||||
-s ENVIRONMENT=node
|
||||
|
||||
|
||||
|
||||
|
||||
gcc opencl_add_cpu.c -o ./binaries/opencl_add_cpu -lOpenCL
|
||||
|
||||
gcc add_single_core.c -o ./binaries/add_single_core
|
||||
|
||||
gcc pthread_add.c -o ./binaries/pthread_add
|
||||
|
||||
gcc openmp_add.c -O3 -o ./binaries/openmp_add -O3 -fopenmp
|
||||
|
||||
gcc opencl_add_gpu.c -o ./binaries/opencl_add_gpu -lOpenCL
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
read -p "Press enter to continue"
|
||||
echo ""
|
||||
echo "OpenCl Cpu only"
|
||||
echo ""
|
||||
|
||||
./binaries/opencl_add_cpu
|
||||
|
||||
read -p "Press enter to continue"
|
||||
|
||||
echo ""
|
||||
echo "c native Single Core"
|
||||
echo ""
|
||||
|
||||
./binaries/add_single_core
|
||||
|
||||
read -p "Press enter to continue"
|
||||
|
||||
echo ""
|
||||
echo "c Wasm Nodejs Single Core"
|
||||
echo ""
|
||||
|
||||
node wasm_node.js
|
||||
|
||||
|
||||
read -p "Press enter to continue"
|
||||
|
||||
|
||||
echo ""
|
||||
echo "Nodejs"
|
||||
echo ""
|
||||
|
||||
read -p "Press enter to continue"
|
||||
|
||||
node add_javascript.js
|
||||
|
||||
read -p "Press enter to continue"
|
||||
|
||||
echo ""
|
||||
echo "Pthread Core"
|
||||
echo ""
|
||||
|
||||
./binaries/pthread_add
|
||||
|
||||
echo ""
|
||||
echo "Nodejs Wasm Pthread Fast"
|
||||
echo ""
|
||||
|
||||
node ./wasm_pthread_fast/main.js
|
||||
|
||||
read -p "Press enter to continue"
|
||||
|
||||
|
||||
echo ""
|
||||
echo "OpenMp"
|
||||
echo ""
|
||||
|
||||
./binaries/openmp_add
|
||||
|
||||
read -p "Press enter to continue"
|
||||
|
||||
echo ""
|
||||
echo "OpenCl"
|
||||
echo ""
|
||||
./binaries/opencl_add_gpu
|
||||
|
||||
|
||||
Reference in New Issue
Block a user