This file contains hidden or 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
| #include <iostream> | |
| #include <cstdint> | |
| #include <gmpxx.h> | |
| #include <cassert> | |
| #include <omp.h> | |
| // Single-round Miller-Rabin test using GMP modular exponentiation | |
| inline bool miller_rabin_test(uint32_t n, uint32_t a, uint32_t d, int s) { | |
| mpz_class base(a), exp(d), mod(n), x; | |
This file contains hidden or 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
| """ Latex labels for Graphviz """ | |
| import html | |
| import re | |
| import subprocess | |
| from pylatexenc.latex2text import ( | |
| LatexNodes2Text, | |
| MacroTextSpec, | |
| get_default_latex_context_db as get_default_l2t_context_db, | |
| ) | |
| from pylatexenc.latexwalker import ( |
This file contains hidden or 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
| /* | |
| f=gfx900_multi_precision_bench | |
| hipcc -O3 --offload-arch=gfx900 $f.cpp -o $f | |
| */ | |
| #include <hip/hip_runtime.h> | |
| #include <hip/hip_fp16.h> | |
| #include <iostream> | |
| #include <iomanip> | |
| #include <vector> |
This file contains hidden or 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
| #include <hip/hip_runtime.h> | |
| #include <hip/hip_fp16.h> | |
| #include <iostream> | |
| #include <vector> | |
| #include <thread> | |
| #include <chrono> | |
| #include <iomanip> | |
| #include <atomic> | |
| #include <string> |
This file contains hidden or 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
| #include <iostream> | |
| #include <cstdint> | |
| #include <cuda_runtime.h> | |
| #define CUDA_CHECK(status) \ | |
| do { \ | |
| cudaError_t err = (status); \ | |
| if (err != cudaSuccess) { \ | |
| std::cerr << "[CUDA Error] " << cudaGetErrorString(err) \ | |
| << " (" << err << ") at line " << __LINE__ << std::endl; \ |
This file contains hidden or 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
| #include <iostream> | |
| #include <vector> | |
| #include <cuda_runtime.h> | |
| #include <cublas_v2.h> | |
| #define CUDA_CHECK(status) \ | |
| if (status != cudaSuccess) { \ | |
| std::cerr << "CUDA Error: " << cudaGetErrorString(status) \ | |
| << " at line " << __LINE__ << std::endl; \ | |
| exit(EXIT_FAILURE); \ |
This file contains hidden or 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
| /* | |
| f=AVX2.vsqrtpd | |
| g++ -O3 -fopenmp -Wall -Wextra -pedantic $f.cpp -o $f | |
| cpplint --filter=-legal/copyright $f.cpp | |
| cppcheck --enable=all --suppress=missingIncludeSystem $f.cpp --check-config | |
| echo off | sudo tee /sys/devices/system/cpu/smt/control | |
| echo 0 | sudo tee /proc/sys/kernel/perf_event_paranoid | |
| perf stat -a -e cycles,instructions,task-clock ./$f |
This file contains hidden or 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
| New version for AMD&NVIDIA GPUs: | |
| https://github.com/Hermann-SW/RR/tree/main/tsp/hip |
This file contains hidden or 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
| /* | |
| f=AVX512.vsqrtpd | |
| g++ -O3 -fopenmp -Wall -Wextra -pedantic $f.cpp -o $f | |
| cpplint --filter=-legal/copyright $f.cpp | |
| cppcheck --enable=all --suppress=missingIncludeSystem $f.cpp --check-config | |
| echo off | sudo tee /sys/devices/system/cpu/smt/control | |
| echo 0 | sudo tee /proc/sys/kernel/perf_event_paranoid | |
| perf stat -a -e fp_ops_retired_by_width.pack_512_uops_retired,cycles,instructions,task-clock ./$f |
This file contains hidden or 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
| /* | |
| f=AVX512_VNNI.DP2A_s32_s16_s16 | |
| g++ -O3 -fopenmp -Wall -Wextra -pedantic $f.cpp -o $f | |
| cpplint --filter=-legal/copyright $f.cpp | |
| cppcheck --enable=all --suppress=missingIncludeSystem $f.cpp --check-config | |
| echo off | sudo tee /sys/devices/system/cpu/smt/control | |
| echo 0 | sudo tee /proc/sys/kernel/perf_event_paranoid | |
| perf stat -a -e fp_ops_retired_by_width.pack_512_uops_retired,cycles,instructions,task-clock ./$f |
NewerOlder