├── .gitignore ├── .travis.yml ├── CMakeLists.txt ├── LICENSE ├── Makefile.config ├── NOTICE ├── README.md ├── RELEASE.md ├── TESTING-GUIDE.md ├── bin ├── clang++-fpchecker ├── clang-fpchecker ├── fpc-create-report ├── fpc-debug ├── fpc-report ├── fpchecker ├── g++-fpc ├── mpiCC-fpchecker ├── mpic++-fpchecker ├── mpicc-fpchecker ├── mpiclang++-fpchecker ├── mpiclang-fpchecker ├── mpicxx-fpchecker ├── mpig++-fpchecker ├── mpigcc-fpchecker └── nvcc-fpc ├── cpu_checking ├── cc_frontend.sh ├── cc_mpi_frontend.sh ├── clang_fpchecker.py ├── colors.py ├── cxx_frontend.sh ├── cxx_mpi_frontend.sh ├── exceptions.py ├── fpc_compare_traces.py ├── fpc_create_report.py ├── fpc_logging.py ├── histograms │ ├── fpc_create_exp_usage_report.py │ └── report_templates │ │ ├── icons │ │ └── logo_fpchecker.png │ │ ├── index.html │ │ ├── sample_plot.png │ │ └── sitestyle.css ├── line_highlighting.py ├── mpicc_fpchecker.py └── report_templates │ ├── event_report_template.html │ ├── icons │ ├── cancellation.svg │ ├── comparison.svg │ ├── div_zero.svg │ ├── high_icon.svg │ ├── infinity_neg.svg │ ├── infinity_pos.svg │ ├── latent_infinity_neg.svg │ ├── latent_infinity_pos.svg │ ├── latent_underflow.svg │ ├── logo_fpchecker.png │ ├── low_icon.svg │ ├── medium_icon.svg │ ├── nan.svg │ └── underflow.svg │ ├── icons_2 │ ├── div_zero.svg │ ├── infinity_neg.svg │ ├── infinity_pos.svg │ ├── nan.svg │ └── underflow.svg │ ├── icons_3 │ ├── cancellation.svg │ ├── comparison.svg │ ├── div_zero.svg │ ├── high_icon.svg │ ├── infinity_neg.svg │ ├── infinity_pos.svg │ ├── logo_fpchecker.png │ ├── low_icon.svg │ ├── medium_icon.svg │ ├── nan.svg │ ├── underflow.svg │ └── warning.svg │ ├── index.html │ ├── sitestyle.css │ └── source_report_template.html ├── figures └── logo_fpchecker.png ├── fpc_spack_repo ├── packages │ └── package.py └── repo.yaml ├── interception_tool ├── colors.py ├── fpchecker.py ├── intercept.c ├── intercept.h.in └── makefile ├── lib ├── limitations.md ├── parser ├── colors.py ├── config_reader.py ├── deprocess.py ├── exceptions.py ├── fpc-debug.py ├── fpc_logging.py ├── g++_fpchecker.py ├── instrument.py ├── match.py ├── nvcc_fpchecker.py ├── test.ini └── tokenizer.py ├── plugin ├── Makefile ├── clang-fpchecker └── instrumentation_plugin.cpp ├── src ├── CodeMatching.cpp ├── CodeMatching.h ├── CommonTypes.h ├── FPC_Hashtable.h ├── Instrumentation.cpp ├── Instrumentation.h ├── Instrumentation_cpu.cpp ├── Instrumentation_cpu.h ├── Logging.cpp ├── Logging.h ├── Makefile ├── Runtime.h ├── Runtime_cpu.h ├── Runtime_g++.h ├── Runtime_parser.h ├── Runtime_plugin.h ├── Utility.cpp ├── Utility.h ├── driver.cpp └── driver_cpu.cpp ├── tests ├── Makefile.config ├── clang_plugin │ ├── dynamic │ │ ├── test_fp32_overflow_found │ │ │ ├── Makefile │ │ │ ├── dot_product.cu.orig │ │ │ ├── dot_product.h │ │ │ ├── main.cu.orig │ │ │ └── test_fp32_overflow_found.py │ │ ├── test_fp64_almost_overflow_found_dont_abort │ │ │ ├── Makefile.1 │ │ │ ├── Makefile.2 │ │ │ ├── dot_product.cu.orig │ │ │ ├── dot_product.h │ │ │ ├── main.cu.orig │ │ │ └── test_fp64_almost_overflow_found_dont_abort.py │ │ ├── test_fp64_almost_underflow_found │ │ │ ├── Makefile.1 │ │ │ ├── Makefile.2 │ │ │ ├── dot_product.cu.orig │ │ │ ├── dot_product.h │ │ │ ├── main.cu.orig │ │ │ └── test_fp64_almost_underflow_found.py │ │ ├── test_fp64_almost_underflow_found_dont_abort │ │ │ ├── Makefile.1 │ │ │ ├── Makefile.2 │ │ │ ├── dot_product.cu.orig │ │ │ ├── dot_product.h │ │ │ ├── main.cu.orig │ │ │ └── test_fp64_almost_underflow_found_dont_abort.py │ │ ├── test_fp64_flags │ │ │ ├── Makefile │ │ │ ├── Makefile.no_subnormal │ │ │ ├── Makefile.no_warnings │ │ │ ├── Makefile.no_warnings_and_subnormal │ │ │ ├── dot_product.cu.orig │ │ │ ├── dot_product.h │ │ │ ├── main.cu.orig │ │ │ └── test_fp64_flags.py │ │ ├── test_fp64_nan_found │ │ │ ├── Makefile │ │ │ ├── dot_product.cu.orig │ │ │ ├── dot_product.h │ │ │ ├── main.cu.orig │ │ │ └── test_fp64_nan_found.py │ │ ├── test_fp64_nan_found_dont_abort │ │ │ ├── Makefile │ │ │ ├── dot_product.cu.orig │ │ │ ├── dot_product.h │ │ │ ├── main.cu.orig │ │ │ └── test_fp64_nan_found_dont_abort.py │ │ ├── test_fp64_overflow_found │ │ │ ├── Makefile.1 │ │ │ ├── Makefile.2 │ │ │ ├── dot_product.cu.orig │ │ │ ├── dot_product.h │ │ │ ├── main.cu.orig │ │ │ └── test_fp64_overflow_found.py │ │ ├── test_fp64_overflow_found_dont_abort │ │ │ ├── Makefile │ │ │ ├── dot_product.cu.orig │ │ │ ├── dot_product.h │ │ │ ├── main.cu.orig │ │ │ └── test_fp64_overflow_found_dont_abort.py │ │ ├── test_fp64_underflow_found │ │ │ ├── Makefile │ │ │ ├── compute.h │ │ │ ├── dot_product.cu.orig │ │ │ ├── dot_product.h │ │ │ ├── main.cu.orig │ │ │ └── test_fp64_underflow_found.py │ │ ├── test_fp64_underflow_found_dont_abort │ │ │ ├── Makefile │ │ │ ├── compute.h │ │ │ ├── dot_product.cu.orig │ │ │ ├── dot_product.h │ │ │ ├── main.cu.orig │ │ │ └── test_fp64_underflow_found_dont_abort.py │ │ ├── test_host_fp32_overflow_found │ │ │ ├── Makefile │ │ │ ├── dot_product.cu.orig │ │ │ ├── dot_product.h │ │ │ ├── main.cu.orig │ │ │ └── test_host_fp32_overflow_found.py │ │ ├── test_host_fp64_nan_found │ │ │ ├── Makefile │ │ │ ├── dot_product.cu.orig │ │ │ ├── dot_product.h │ │ │ ├── main.cu.orig │ │ │ └── test_host_fp64_nan_found.py │ │ ├── test_host_fp64_overflow_found │ │ │ ├── Makefile.1 │ │ │ ├── Makefile.2 │ │ │ ├── dot_product.cu.orig │ │ │ ├── dot_product.h │ │ │ ├── main.cu.orig │ │ │ └── test_host_fp64_overflow_found.py │ │ └── test_host_fp64_underflow_found │ │ │ ├── Makefile │ │ │ ├── compute.h │ │ │ ├── dot_product.cu.orig │ │ │ ├── dot_product.h │ │ │ ├── main.cu.orig │ │ │ └── test_host_fp64_underflow_found.py │ └── static │ │ ├── test_already_instrumented │ │ ├── Makefile.0 │ │ ├── compute.cu.orig │ │ └── test_already_instrumented.py │ │ ├── test_comp_assignment │ │ ├── Makefile.0 │ │ ├── compute.cu.orig │ │ └── test_comp_assignment.py │ │ ├── test_constant_expressions │ │ ├── Makefile.0 │ │ ├── compute.cu.orig │ │ └── test_constant_expressions.py │ │ ├── test_declarations │ │ ├── Makefile.0 │ │ ├── compute.cu.orig │ │ └── test_declarations.py │ │ ├── test_host_device │ │ ├── Makefile.0 │ │ ├── compute.cu.orig │ │ └── test_host_device.py │ │ ├── test_integer_types │ │ ├── Makefile.0 │ │ ├── compute.cu.orig │ │ └── test_integer_types.py │ │ ├── test_make_nested_dirs │ │ ├── Makefile.0 │ │ ├── src │ │ │ └── src │ │ │ │ ├── compute.cu │ │ │ │ └── compute.cu.orig │ │ └── test_make_nested_dirs.py │ │ ├── test_multi_lines │ │ ├── Makefile.0 │ │ ├── compute.cu.orig │ │ └── test_multi_lines.py │ │ ├── test_pointer_expressions │ │ ├── Makefile.0 │ │ ├── compute.cu │ │ └── compute.cu.orig │ │ ├── test_simple_lambda │ │ ├── Makefile.0 │ │ ├── compute.cpp.orig │ │ └── test_simple_lambda.py │ │ ├── test_static_initialization │ │ ├── Makefile.0 │ │ ├── compute.cu.orig │ │ └── test_static_initialization.py │ │ └── test_two_compilations │ │ ├── Makefile.0 │ │ ├── compute.cu.orig │ │ └── test_two_compilations.py ├── cpu_checking │ ├── dynamic │ │ ├── __init__.py │ │ ├── report.py │ │ ├── test_c_and_cpp │ │ │ ├── Makefile │ │ │ ├── __init__.py │ │ │ ├── compute.cpp │ │ │ ├── compute.h │ │ │ ├── compute_2.c │ │ │ ├── compute_2.h │ │ │ ├── main.cpp │ │ │ └── test_c_and_cpp.py │ │ ├── test_clang_interceptor │ │ │ ├── Makefile │ │ │ ├── __init__.py │ │ │ ├── compute.cpp │ │ │ ├── compute.h │ │ │ ├── main.cpp │ │ │ └── test_clang_interceptor.py │ │ ├── test_cmake_multidir │ │ │ ├── CMakeLists.txt │ │ │ ├── __init__.py │ │ │ ├── src │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── core │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ ├── server.cpp │ │ │ │ │ └── server.h │ │ │ │ ├── main.cpp │ │ │ │ └── util │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ ├── util.cpp │ │ │ │ │ └── util.h │ │ │ └── test_cmake_multidir.py │ │ ├── test_conditional_operations │ │ │ ├── Makefile.1 │ │ │ ├── Makefile.2 │ │ │ ├── __init__.py │ │ │ ├── compute.cpp │ │ │ ├── compute.h │ │ │ ├── main.cpp │ │ │ └── test_conditional_operations.py │ │ ├── test_fast_checking │ │ │ ├── Makefile │ │ │ ├── Makefile_fast │ │ │ ├── __init__.py │ │ │ ├── compute.cpp │ │ │ ├── compute.h │ │ │ ├── main.cpp │ │ │ └── test_fast_checking.py │ │ ├── test_fp32_cancellation │ │ │ ├── Makefile │ │ │ ├── __init__.py │ │ │ ├── compute.cpp │ │ │ ├── compute.h │ │ │ ├── main.cpp │ │ │ └── test_fp32_cancellation.py │ │ ├── test_fp32_comparison │ │ │ ├── Makefile │ │ │ ├── __init__.py │ │ │ ├── compute.cpp │ │ │ ├── compute.h │ │ │ ├── main.cpp │ │ │ └── test_fp32_comparison.py │ │ ├── test_fp32_division_zero │ │ │ ├── Makefile │ │ │ ├── __init__.py │ │ │ ├── compute.cpp │ │ │ ├── compute.h │ │ │ ├── main.cpp │ │ │ └── test_fp32_division_zero.py │ │ ├── test_fp32_histogram_for_events │ │ │ ├── Makefile │ │ │ ├── __init__.py │ │ │ ├── compute.cpp │ │ │ ├── compute.h │ │ │ ├── main.cpp │ │ │ └── test_fp32_histogram_for_events.py │ │ ├── test_fp32_histogram_traces │ │ │ ├── Makefile │ │ │ ├── __init__.py │ │ │ ├── compute.cpp │ │ │ ├── compute.h │ │ │ ├── main.cpp │ │ │ └── test_fp32_histogram_traces.py │ │ ├── test_fp32_infinity_neg │ │ │ ├── Makefile │ │ │ ├── __init__.py │ │ │ ├── compute.cpp │ │ │ ├── compute.h │ │ │ ├── main.cpp │ │ │ └── test_fp32_infinity_neg.py │ │ ├── test_fp32_infinity_pos │ │ │ ├── Makefile │ │ │ ├── __init__.py │ │ │ ├── compute.cpp │ │ │ ├── compute.h │ │ │ ├── main.cpp │ │ │ └── test_fp32_infinity_pos.py │ │ ├── test_fp32_latent_infinity_neg │ │ │ ├── Makefile │ │ │ ├── __init__.py │ │ │ ├── compute.cpp │ │ │ ├── compute.h │ │ │ ├── main.cpp │ │ │ └── test_fp32_latent_infinity_neg.py │ │ ├── test_fp32_latent_infinity_pos │ │ │ ├── Makefile │ │ │ ├── __init__.py │ │ │ ├── compute.cpp │ │ │ ├── compute.h │ │ │ ├── main.cpp │ │ │ └── test_fp32_latent_infinity_pos.py │ │ ├── test_fp32_latent_subnormal │ │ │ ├── Makefile │ │ │ ├── __init__.py │ │ │ ├── compute.cpp │ │ │ ├── compute.h │ │ │ ├── main.cpp │ │ │ └── test_fp32_latent_subnormal.py │ │ ├── test_fp32_nan │ │ │ ├── Makefile │ │ │ ├── __init__.py │ │ │ ├── compute.cpp │ │ │ ├── compute.h │ │ │ ├── main.cpp │ │ │ └── test_fp32_nan.py │ │ ├── test_fp32_subnormal │ │ │ ├── Makefile │ │ │ ├── __init__.py │ │ │ ├── compute.cpp │ │ │ ├── compute.h │ │ │ ├── main.cpp │ │ │ └── test_fp32_subnormal.py │ │ ├── test_fp64_cancellation │ │ │ ├── Makefile │ │ │ ├── __init__.py │ │ │ ├── compute.cpp │ │ │ ├── compute.h │ │ │ ├── main.cpp │ │ │ └── test_fp64_cancellation.py │ │ ├── test_fp64_comparison │ │ │ ├── Makefile │ │ │ ├── __init__.py │ │ │ ├── compute.cpp │ │ │ ├── compute.h │ │ │ ├── main.cpp │ │ │ └── test_fp64_comparison.py │ │ ├── test_fp64_division_zero │ │ │ ├── Makefile │ │ │ ├── __init__.py │ │ │ ├── compute.cpp │ │ │ ├── compute.h │ │ │ ├── main.cpp │ │ │ └── test_fp64_division_zero.py │ │ ├── test_fp64_histogram_for_events │ │ │ ├── Makefile │ │ │ ├── __init__.py │ │ │ ├── compute.cpp │ │ │ ├── compute.h │ │ │ ├── main.cpp │ │ │ └── test_fp64_histogram_for_events.py │ │ ├── test_fp64_histogram_traces │ │ │ ├── Makefile │ │ │ ├── __init__.py │ │ │ ├── compute.cpp │ │ │ ├── compute.h │ │ │ ├── main.cpp │ │ │ └── test_fp64_histogram_traces.py │ │ ├── test_fp64_infinity_neg │ │ │ ├── Makefile │ │ │ ├── __init__.py │ │ │ ├── compute.cpp │ │ │ ├── compute.h │ │ │ ├── main.cpp │ │ │ └── test_fp64_infinity_neg.py │ │ ├── test_fp64_infinity_pos │ │ │ ├── Makefile │ │ │ ├── __init__.py │ │ │ ├── compute.cpp │ │ │ ├── compute.h │ │ │ ├── main.cpp │ │ │ └── test_fp64_infinity_pos.py │ │ ├── test_fp64_latent_infinity_neg │ │ │ ├── Makefile │ │ │ ├── __init__.py │ │ │ ├── compute.cpp │ │ │ ├── compute.h │ │ │ ├── main.cpp │ │ │ └── test_fp64_latent_infinity_neg.py │ │ ├── test_fp64_latent_infinity_pos │ │ │ ├── Makefile │ │ │ ├── __init__.py │ │ │ ├── compute.cpp │ │ │ ├── compute.h │ │ │ ├── main.cpp │ │ │ └── test_fp64_latent_infinity_pos.py │ │ ├── test_fp64_latent_subnormal │ │ │ ├── Makefile │ │ │ ├── __init__.py │ │ │ ├── compute.cpp │ │ │ ├── compute.h │ │ │ ├── main.cpp │ │ │ └── test_fp64_latent_subnormal.py │ │ ├── test_fp64_nan │ │ │ ├── Makefile │ │ │ ├── __init__.py │ │ │ ├── compute.cpp │ │ │ ├── compute.h │ │ │ ├── main.cpp │ │ │ └── test_fp64_nan.py │ │ ├── test_fp64_subnormal │ │ │ ├── Makefile │ │ │ ├── __init__.py │ │ │ ├── compute.cpp │ │ │ ├── compute.h │ │ │ ├── main.cpp │ │ │ └── test_fp64_subnormal.py │ │ ├── test_histogram_plotting │ │ │ ├── Makefile │ │ │ ├── __init__.py │ │ │ ├── compute.cpp │ │ │ ├── compute.h │ │ │ ├── main.cpp │ │ │ └── test_histogram_plotting.py │ │ ├── test_long_filename │ │ │ ├── Makefile │ │ │ ├── __init__.py │ │ │ ├── compute.h │ │ │ ├── compute_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long.cpp │ │ │ ├── main.cpp │ │ │ └── test_long_filename.py │ │ ├── test_long_paths │ │ │ ├── Makefile │ │ │ ├── __init__.py │ │ │ ├── compute.h │ │ │ ├── long_path │ │ │ │ └── long_path │ │ │ │ │ └── long_path │ │ │ │ │ └── long_path │ │ │ │ │ └── long_path │ │ │ │ │ └── long_path │ │ │ │ │ └── long_path │ │ │ │ │ └── long_path │ │ │ │ │ └── long_path │ │ │ │ │ └── long_path │ │ │ │ │ └── long_path │ │ │ │ │ └── long_path │ │ │ │ │ └── compute.cpp │ │ │ ├── main.cpp │ │ │ └── test_long_paths.py │ │ ├── test_main_instrumentation │ │ │ ├── Makefile │ │ │ ├── __init__.py │ │ │ ├── main_1.cpp │ │ │ ├── main_2.cpp │ │ │ ├── main_3.cpp │ │ │ ├── main_4.c │ │ │ ├── main_5.c │ │ │ ├── main_6.c │ │ │ ├── main_7.c │ │ │ └── test_main_instrumentation.py │ │ ├── test_mpi_interceptor │ │ │ ├── Makefile │ │ │ ├── __init__.py │ │ │ ├── compute.cpp │ │ │ ├── compute.h │ │ │ ├── main.cpp │ │ │ └── test_mpi_interceptor.py │ │ ├── test_mpi_run │ │ │ ├── Makefile │ │ │ ├── __init__.py │ │ │ ├── compute.cpp │ │ │ ├── compute.h │ │ │ ├── main.cpp │ │ │ └── test_mpi_run.py │ │ ├── test_mpi_with_strings │ │ │ ├── Makefile │ │ │ ├── __init__.py │ │ │ ├── compute.cpp │ │ │ ├── compute.h │ │ │ ├── main.cpp │ │ │ └── test_mpi_with_strings.py │ │ ├── test_multi_files │ │ │ ├── .fpc_log.txt │ │ │ ├── Makefile │ │ │ ├── __init__.py │ │ │ ├── header.h │ │ │ ├── main.cpp │ │ │ └── test_multi_files.py │ │ ├── test_openmp │ │ │ ├── Makefile │ │ │ ├── __init__.py │ │ │ ├── compute.cpp │ │ │ ├── compute.h │ │ │ ├── get_omp_lib_path.sh │ │ │ ├── main.cpp │ │ │ └── test_openmp.py │ │ ├── test_str_comparisons │ │ │ ├── Makefile │ │ │ ├── __init__.py │ │ │ ├── main.cpp │ │ │ └── test_str_comparisons.py │ │ ├── test_string_compile_param │ │ │ ├── Makefile │ │ │ ├── __init__.py │ │ │ ├── compute.cpp │ │ │ ├── compute.h │ │ │ ├── main.cpp │ │ │ └── test_string_compile_param.py │ │ └── test_traps_with_env_variables │ │ │ ├── Makefile │ │ │ ├── __init__.py │ │ │ ├── compute.cpp │ │ │ ├── compute.h │ │ │ ├── main.cpp │ │ │ └── test_traps_with_env_variables.py │ └── static │ │ ├── test_build_mpi │ │ ├── Makefile │ │ ├── compute.cpp │ │ ├── compute.h │ │ ├── main.cpp │ │ └── test_build_mpi.py │ │ ├── test_compare_traces │ │ ├── dir1 │ │ │ ├── fpc_lassen708_40200.json │ │ │ └── fpc_lassen708_40201.json │ │ └── dir2 │ │ │ ├── fpc_lassen708_40200.json │ │ │ └── fpc_lassen708_40201.json │ │ ├── test_full_report_generation │ │ ├── .fpc_logs │ │ │ └── fpc_lassen708_40200.json │ │ ├── main.cpp │ │ └── src │ │ │ ├── compute.cpp │ │ │ └── compute.h │ │ ├── test_generate_report │ │ ├── .fpc_logs │ │ │ └── fpc_lassen708_40200.json │ │ ├── dir1 │ │ │ └── .fpc_logs │ │ │ │ └── fpc_lassen708_40201.json │ │ ├── test.cpp │ │ └── test_generate_report.py │ │ ├── test_histograms_plots │ │ ├── .fpc_logs │ │ │ ├── fpc_lassen708_61961.json │ │ │ └── histogram_lassen708_61961.json │ │ └── test_histograms_plots.py │ │ ├── test_query_traces │ │ ├── .fpc_logs │ │ │ └── fpc_lassen708_40200.json │ │ ├── dir1 │ │ │ ├── .fpc_logs │ │ │ │ └── fpc_lassen708_40205.json │ │ │ └── dir2 │ │ │ │ └── .fpc_logs │ │ │ │ └── fpc_lassen708_4077.json │ │ ├── query_file.json │ │ └── test.cpp │ │ ├── test_recover_original_command │ │ ├── Makefile │ │ ├── header.h │ │ ├── main.cpp │ │ └── test_recover_original_command.py │ │ ├── test_remove_traces │ │ ├── test_remove_traces.py │ │ └── traces │ │ │ └── fpc_lassen708_40200.json │ │ ├── test_show_text_report │ │ ├── .fpc_logs │ │ │ └── fpc_lassen708_40200.json │ │ ├── test.cpp │ │ └── test_show_text_report.py │ │ └── test_warnings │ │ ├── Makefile │ │ ├── __init__.py │ │ ├── compute.cpp │ │ ├── compute.h │ │ ├── main.cpp │ │ └── test_warnings.py ├── llvm │ ├── dynamic │ │ ├── _test_config.py │ │ ├── _test_config.py.in │ │ ├── get_cuda_lib_path.sh │ │ ├── test.py │ │ ├── test_debug_info_is_correct │ │ │ ├── Makefile │ │ │ ├── dot_product.cu │ │ │ ├── dot_product.h │ │ │ ├── main.cu │ │ │ ├── orig.test.py │ │ │ └── test_debug_info_is_correct.py │ │ ├── test_errors_dont_abort │ │ │ ├── Makefile.0 │ │ │ ├── Makefile.1 │ │ │ ├── Makefile.2 │ │ │ ├── Makefile.3 │ │ │ ├── dot_product.cu │ │ │ ├── dot_product.h │ │ │ ├── main.cu │ │ │ ├── orig.test.py │ │ │ └── test_errors_dont_abort.py │ │ ├── test_fp32_almost_underflow_found │ │ │ ├── Makefile.1 │ │ │ ├── Makefile.2 │ │ │ ├── dot_product.cu │ │ │ ├── dot_product.h │ │ │ ├── main.cu │ │ │ ├── orig.test.py │ │ │ └── test_fp32_almost_underflow_found.py │ │ ├── test_fp32_nan_found │ │ │ ├── Makefile │ │ │ ├── dot_product.cu │ │ │ ├── dot_product.h │ │ │ ├── main.cu │ │ │ ├── old.test.py │ │ │ └── test_fp32_nan_found.py │ │ ├── test_fp32_overflow_found │ │ │ ├── Makefile │ │ │ ├── dot_product.cu │ │ │ ├── dot_product.h │ │ │ ├── main.cu │ │ │ ├── orig.test.py │ │ │ └── test_fp32_overflow_found.py │ │ ├── test_fp32_underflow_found │ │ │ ├── Makefile │ │ │ ├── dot_product.cu │ │ │ ├── dot_product.h │ │ │ ├── main.cu │ │ │ ├── old.test.py │ │ │ └── test_fp32_underflow_found.py │ │ ├── test_fp64_almost_underflow_found │ │ │ ├── Makefile.1 │ │ │ ├── Makefile.2 │ │ │ ├── dot_product.cu │ │ │ ├── dot_product.h │ │ │ ├── main.cu │ │ │ ├── orig.test.py │ │ │ └── test_fp64_almost_underflow_found.py │ │ ├── test_fp64_nan_found │ │ │ ├── Makefile │ │ │ ├── dot_product.cu │ │ │ ├── dot_product.h │ │ │ ├── main.cu │ │ │ ├── old.test.py │ │ │ └── test_fp64_nan_found.py │ │ ├── test_fp64_overflow_found │ │ │ ├── Makefile.1 │ │ │ ├── Makefile.2 │ │ │ ├── dot_product.cu │ │ │ ├── dot_product.h │ │ │ ├── main.cu │ │ │ ├── orig.test.py │ │ │ └── test_fp64_overflow_found.py │ │ ├── test_fp64_underflow_found │ │ │ ├── Makefile │ │ │ ├── compute.cu │ │ │ ├── compute.h │ │ │ ├── dot_product.cu │ │ │ ├── dot_product.h │ │ │ ├── main.cu │ │ │ ├── old.test.py │ │ │ └── test_fp64_underflow_found.py │ │ ├── test_ops_are_correct │ │ │ ├── Makefile.1 │ │ │ ├── Makefile.2 │ │ │ ├── Makefile.3 │ │ │ ├── Makefile.4 │ │ │ ├── dot_product.cu │ │ │ ├── dot_product.h │ │ │ ├── main.cu │ │ │ ├── orig.test.py │ │ │ └── test_ops_are_correct.py │ │ ├── test_performance_errors_dont_abort │ │ │ ├── Makefile │ │ │ ├── arr_sum.cu │ │ │ ├── arr_sum.h │ │ │ ├── benchmark.py │ │ │ ├── generateCode.py │ │ │ ├── get_node_with_GPU.sh │ │ │ └── main.cu │ │ ├── test_print_at_main │ │ │ ├── Makefile │ │ │ ├── dot_product.cu │ │ │ ├── dot_product.h │ │ │ ├── main.cu │ │ │ ├── orig.test.py │ │ │ └── test_print_at_main.py │ │ ├── test_raja_examples │ │ │ ├── Makefile.errors_abort │ │ │ ├── Makefile.errors_dont_abort │ │ │ ├── dot_product_raja.cpp │ │ │ ├── memoryManager.hpp │ │ │ ├── orig.test.py │ │ │ └── test_raja_examples.py │ │ ├── test_warning_dont_abort │ │ │ ├── Makefile.0 │ │ │ ├── Makefile.1 │ │ │ ├── Makefile.2 │ │ │ ├── Makefile.3 │ │ │ ├── dot_product.cu │ │ │ ├── dot_product.h │ │ │ ├── main.cu │ │ │ └── test.py │ │ └── test_warnings_dont_abort │ │ │ ├── Makefile.0 │ │ │ ├── Makefile.1 │ │ │ ├── Makefile.2 │ │ │ ├── Makefile.3 │ │ │ ├── dot_product.cu │ │ │ ├── dot_product.h │ │ │ ├── main.cu │ │ │ ├── orig.test.py │ │ │ └── test_warnings_dont_abort.py │ └── static │ │ ├── _test_config.py │ │ ├── _test_config.py.in │ │ ├── test.py │ │ ├── test_correct_inst_functions_found │ │ ├── Makefile.0 │ │ ├── Makefile.1 │ │ ├── Makefile.2 │ │ ├── Makefile.3 │ │ ├── compute.cu │ │ ├── old.test.py │ │ └── test_correct_inst_functions_found.py │ │ ├── test_device_func_found │ │ ├── Makefile │ │ ├── compute.cu │ │ ├── old.test.py │ │ └── test_device_func_found.py │ │ ├── test_find_inst_functions │ │ ├── Makefile │ │ ├── compute.cu │ │ ├── old.test.py │ │ └── test_find_inst_functions.py │ │ ├── test_global_array_instrumentation │ │ ├── Makefile.0 │ │ ├── Makefile.1 │ │ ├── Makefile.2 │ │ ├── Makefile.3 │ │ ├── compute.cu │ │ ├── get_llmv_ir.sh │ │ ├── old.test.py │ │ └── test_global_array_instrumentation.py │ │ ├── test_global_func_found │ │ ├── Makefile │ │ ├── compute.cu │ │ ├── old.test.py │ │ └── test_global_func_found.py │ │ ├── test_global_warnings_instrumentation │ │ ├── Makefile.0 │ │ ├── Makefile.1 │ │ ├── Makefile.2 │ │ ├── Makefile.3 │ │ ├── compute.cu │ │ ├── get_llmv_ir.sh │ │ └── test.py │ │ ├── test_main_is_found │ │ ├── Makefile │ │ ├── compute.cu │ │ ├── get_llvm.sh │ │ ├── old.test.py │ │ └── test_main_is_found.py │ │ ├── test_number_fp_operations │ │ ├── Makefile │ │ ├── compute.cu │ │ ├── old.test.py │ │ └── test_number_fp_operations.py │ │ └── test_simple_cuda │ │ ├── Makefile │ │ ├── compute.cu │ │ ├── compute.h │ │ ├── get_ir.sh │ │ ├── get_node_with_GPU.sh │ │ └── main.cu ├── parser │ ├── dynamic │ │ ├── test_fp64_almost_overflow_found_dont_abort │ │ │ ├── Makefile.1 │ │ │ ├── Makefile.2 │ │ │ ├── dot_product.cu.orig │ │ │ ├── dot_product.h │ │ │ ├── main.cu.orig │ │ │ └── test_fp64_almost_overflow_found_dont_abort.py │ │ ├── test_fp64_almost_underflow_found │ │ │ ├── Makefile.1 │ │ │ ├── Makefile.2 │ │ │ ├── dot_product.cu.orig │ │ │ ├── dot_product.h │ │ │ ├── main.cu.orig │ │ │ └── test_fp64_almost_underflow_found.py │ │ ├── test_fp64_almost_underflow_found_dont_abort │ │ │ ├── Makefile.1 │ │ │ ├── Makefile.2 │ │ │ ├── dot_product.cu.orig │ │ │ ├── dot_product.h │ │ │ ├── main.cu.orig │ │ │ └── test_fp64_almost_underflow_found_dont_abort.py │ │ ├── test_fp64_nan_found │ │ │ ├── Makefile │ │ │ ├── dot_product.cu.orig │ │ │ ├── dot_product.h │ │ │ ├── main.cu.orig │ │ │ └── test_fp64_nan_found.py │ │ ├── test_fp64_nan_found_dont_abort │ │ │ ├── Makefile │ │ │ ├── dot_product.cu.orig │ │ │ ├── dot_product.h │ │ │ ├── main.cu.orig │ │ │ └── test_fp64_nan_found_dont_abort.py │ │ ├── test_fp64_overflow_found │ │ │ ├── Makefile.1 │ │ │ ├── Makefile.2 │ │ │ ├── dot_product.cu.orig │ │ │ ├── dot_product.h │ │ │ ├── main.cu.orig │ │ │ └── test_fp64_overflow_found.py │ │ ├── test_fp64_overflow_found_dont_abort │ │ │ ├── Makefile │ │ │ ├── dot_product.cu.orig │ │ │ ├── dot_product.h │ │ │ ├── main.cu.orig │ │ │ └── test_fp64_overflow_found_dont_abort.py │ │ ├── test_fp64_underflow_found │ │ │ ├── Makefile │ │ │ ├── compute.h │ │ │ ├── dot_product.cu.orig │ │ │ ├── dot_product.h │ │ │ ├── main.cu.orig │ │ │ └── test_fp64_underflow_found.py │ │ ├── test_fp64_underflow_found_dont_abort │ │ │ ├── Makefile │ │ │ ├── compute.h │ │ │ ├── dot_product.cu.orig │ │ │ ├── dot_product.h │ │ │ ├── main.cu.orig │ │ │ └── test_fp64_underflow_found_dont_abort.py │ │ └── test_intercept_make │ │ │ ├── Makefile │ │ │ ├── __init__.py │ │ │ ├── src │ │ │ ├── Makefile │ │ │ └── dir │ │ │ │ ├── Makefile │ │ │ │ ├── dot_product.cu │ │ │ │ ├── dot_product.h │ │ │ │ └── main.cu │ │ │ └── test_intercept_make.py │ └── static │ │ ├── test_compile_derived_types │ │ ├── .fpc_log.txt │ │ ├── Makefile │ │ ├── simple.cu │ │ ├── simple.cu.ii │ │ ├── simple.hpp │ │ ├── simple_inst.cu │ │ └── test_compile_derived_types.py │ │ ├── test_deprocess_empty │ │ ├── MemUtils_HIP.cpp │ │ ├── MemUtils_HIP.cpp.o.ii │ │ ├── newFile.cpp │ │ └── test_deprocess_empty.py │ │ ├── test_end_of_file │ │ ├── simple.cu │ │ └── test_end_of_file.py │ │ ├── test_g++_simple │ │ ├── .fpc_log.txt │ │ └── test_g++_simple.py │ │ ├── test_instrument_comments │ │ ├── newFile.cpp │ │ ├── strip_comment.py │ │ └── test_instrument_comments.py │ │ ├── test_instrument_definition_assignment │ │ ├── test_instrument_definition_assignment_1.py │ │ ├── test_instrument_definition_assignment_2.py │ │ ├── test_instrument_definition_assignment_3.py │ │ ├── test_instrument_definition_assignment_4.py │ │ └── test_instrument_definition_assignment_5.py │ │ ├── test_instrument_lambda │ │ ├── Makefile │ │ ├── compute.cu │ │ └── test_instrument_lambda.py │ │ ├── test_instrument_macro │ │ ├── config.ini │ │ └── test_instrument_macro.py │ │ ├── test_instrument_macro_unused_parms │ │ └── test_instrument_macro_unused_parms.py │ │ ├── test_instrument_multiline_macro │ │ ├── config.ini │ │ └── test_instrument_multiline_macro.py │ │ ├── test_instrument_pointers │ │ └── test_instrument_pointers.py │ │ ├── test_instrument_templates │ │ ├── Makefile │ │ ├── compute.cu │ │ ├── header.hpp │ │ └── test_instrument_templates.py │ │ ├── test_match_assignments │ │ ├── test_match_assignments_1.py │ │ ├── test_match_assignments_2.py │ │ ├── test_match_assignments_3.py │ │ └── test_match_assignments_4.py │ │ ├── test_match_device_host_spaces │ │ ├── .fpc_log.txt │ │ ├── dot_product.cu │ │ ├── dot_product.h │ │ ├── dot_product_inst.cu │ │ ├── test_match_device_host_program.py │ │ └── test_match_device_host_spaces.py │ │ ├── test_tokenize_chars │ │ ├── simple.cu │ │ └── test_tokenize_chars.py │ │ ├── test_tokenize_nested_loops │ │ └── test_nested_loops.py │ │ ├── test_tokenize_simple │ │ ├── simple.cu │ │ └── test_tokenize_simple.py │ │ └── test_tokenize_strings │ │ ├── simple.cu │ │ └── test_tokenize_strings.py ├── tests.sh ├── tests_Makefile.in └── tracing_tool │ ├── __init__.py │ └── dynamic │ ├── __init__.py │ ├── conftest.py │ ├── test_assign_to_reference │ ├── Makefile │ ├── __init__.py │ ├── dot_product.cu │ ├── dot_product.h │ ├── main.cu │ └── test_assign_to_reference.py │ ├── test_chdir │ ├── Makefile │ ├── __init__.py │ ├── src │ │ ├── dot_product.cu │ │ ├── dot_product.h │ │ └── main.cu │ └── test_chdir.py │ ├── test_class_members │ ├── Makefile │ ├── __init__.py │ ├── circle.cpp │ ├── circle.h │ ├── compute.cu │ ├── compute.h │ ├── main.cu │ └── test_class_members.py │ ├── test_cmake_cuda │ ├── CMakeLists.txt │ ├── __init__.py │ ├── src │ │ ├── CMakeLists.txt │ │ ├── compute.cu │ │ ├── compute.h │ │ ├── compute_copy.cu │ │ ├── main.cu │ │ └── main_copy.cu │ └── test_cmake_cuda.py │ ├── test_cmake_multidir │ ├── CMakeLists.txt │ ├── __init__.py │ ├── src │ │ ├── CMakeLists.txt │ │ ├── core │ │ │ ├── CMakeLists.txt │ │ │ ├── server.cpp │ │ │ └── server.h │ │ ├── main.cpp │ │ └── util │ │ │ ├── CMakeLists.txt │ │ │ ├── util.cpp │ │ │ └── util.h │ └── test_cmake_multidir.py │ ├── test_cmake_ninja_cuda │ ├── CMakeLists.txt │ ├── __init__.py │ ├── src │ │ ├── CMakeLists.txt │ │ ├── compute.cu │ │ ├── compute.h │ │ ├── compute_copy.cu │ │ ├── main.cu │ │ └── main_copy.cu │ └── test_cmake_ninja_cuda.py │ ├── test_diff_object_names │ ├── Makefile │ ├── __init__.py │ ├── src │ │ ├── dot_product.cu │ │ ├── dot_product.h │ │ └── main.cu │ └── test_diff_object_names.py │ ├── test_expression_parser │ ├── __init__.py │ ├── test.cpp │ └── test_copy.cpp │ ├── test_flat_make │ ├── Makefile │ ├── __init__.py │ ├── dot_product.cu │ ├── dot_product.h │ ├── main.cu │ └── test_flat_make.py │ ├── test_fortran │ ├── Makefile │ ├── __init__.py │ ├── compute.f95 │ ├── compute.h │ ├── main.c │ └── test_fortran.py │ ├── test_fortran_cmake │ ├── CMakeLists.txt │ ├── __init__.py │ ├── src │ │ ├── CMakeLists.txt │ │ ├── compute │ │ │ ├── CMakeLists.txt │ │ │ ├── compute.f95 │ │ │ └── compute.h │ │ └── main.c │ └── test_fortran_cmake.py │ ├── test_fortran_cmake_openmp │ ├── CMakeLists.txt │ ├── __init__.py │ ├── src │ │ ├── CMakeLists.txt │ │ ├── compute │ │ │ ├── CMakeLists.txt │ │ │ ├── compute.f95 │ │ │ └── compute.h │ │ └── main.c │ └── test_fortran_cmake_openmp.py │ ├── test_fortran_xl │ ├── Makefile │ ├── __init__.py │ ├── compute.f95 │ ├── compute.h │ ├── main.c │ └── test_fortran_xl.py │ ├── test_lvalue_error │ ├── Makefile │ ├── __init__.py │ ├── test.cpp │ └── test_copy.cpp │ ├── test_mkdir │ ├── Makefile │ ├── __init__.py │ ├── src │ │ ├── dot_product.cu │ │ ├── dot_product.h │ │ └── main.cu │ └── test_mkdir.py │ ├── test_mpi_and_nvcc │ ├── Makefile │ ├── __init__.py │ ├── dot_product.cu │ ├── dot_product.h │ ├── main.cu │ └── test_mpi_and_nvcc.py │ ├── test_mpicc_compiler │ ├── Makefile │ ├── __init__.py │ ├── src │ │ ├── cuda_launch.cu │ │ ├── cuda_launch.h │ │ ├── dot_product.cu │ │ ├── dot_product.h │ │ ├── main.cpp │ │ ├── mpi_stuff.cpp │ │ └── mpi_stuff.h │ └── test_mpicc_compiler.py │ ├── test_multidir │ ├── Makefile │ ├── __init__.py │ ├── src │ │ ├── Makefile │ │ └── dir1 │ │ │ └── dir2 │ │ │ ├── dot_product.cu │ │ │ ├── dot_product.h │ │ │ └── dot_product_copy.cu │ └── test_multidir.py │ ├── test_nvcc_flags │ ├── Makefile │ ├── __init__.py │ ├── src │ │ ├── dot_product.cu │ │ ├── dot_product.h │ │ └── main.cu │ └── test_nvcc_flags.py │ ├── test_nvcc_parser │ ├── Makefile │ ├── __init__.py │ ├── compute.cu │ ├── include │ │ └── lib.h │ └── test_nvcc_parser.py │ ├── test_omit_file │ ├── Makefile │ ├── __init__.py │ ├── dot_product.cu │ ├── dot_product.h │ ├── fpchecker_conf.json.orig │ ├── main.cu │ └── test_omit_file.py │ ├── test_one_dir │ ├── Makefile │ ├── __init__.py │ ├── src │ │ ├── dot_product.cu │ │ ├── dot_product.h │ │ └── main.cu │ └── test_one_dir.py │ ├── test_parser_comments │ ├── Makefile │ ├── __init__.py │ ├── dot_product.cu │ ├── dot_product.h │ ├── main.cu │ └── test_parser_comments.py │ ├── test_recursive_make │ ├── Makefile │ ├── __init__.py │ ├── src │ │ ├── Makefile │ │ ├── dot_product.cu │ │ ├── dot_product.h │ │ └── main.cu │ └── test_recursive_make.py │ ├── test_recursive_make_3_levels │ ├── Makefile │ ├── __init__.py │ ├── src │ │ ├── Makefile │ │ └── dir │ │ │ ├── Makefile │ │ │ ├── dot_product.cu │ │ │ ├── dot_product.h │ │ │ └── main.cu │ └── test_recursive_make_3_levels.py │ ├── test_replay_single_command │ ├── Makefile │ ├── __init__.py │ ├── dot_product.cu │ ├── dot_product.h │ ├── main.cu │ └── test_replay_single_command.py │ ├── test_report_failed_commands │ ├── Makefile │ ├── __init__.py │ ├── compute.cu │ ├── compute.h │ ├── dot_product.cu │ ├── dot_product.h │ ├── main.cu │ └── test_report_failed_commands.py │ └── test_rollback │ ├── Makefile │ ├── __init__.py │ ├── compute.cu │ ├── compute.h │ ├── dot_product.cu │ ├── dot_product.h │ ├── main.cu │ └── test_rollback.py └── tracing_tool ├── clang_help.txt ├── colors.py ├── debug_traces.py ├── execute_traces.py ├── expressions_parser.py ├── fpchecker ├── fpchecker.py ├── mpi_environment.py ├── nvcc_options_table.py ├── nvcc_options_v9.2.148.txt ├── nvcc_parser.py ├── strace_module.py └── tracing.py /.gitignore: -------------------------------------------------------------------------------- 1 | *.so 2 | *.o 3 | .cproject 4 | .project 5 | .settings 6 | *.core 7 | /build/ 8 | *.pyc 9 | *.bc 10 | *.ll 11 | main 12 | *.swp 13 | .nfs* 14 | *.pytest_cache* 15 | .cache 16 | .fpchecker/ 17 | .DS_Store 18 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | 2 | language: cpp 3 | compiler: clang-12 4 | sudo: false 5 | dist: focal 6 | 7 | addons: 8 | packages: 9 | - clang-12 10 | 11 | script: 12 | - mkdir build 13 | - cd build 14 | - cmake ../ 15 | - make 16 | -------------------------------------------------------------------------------- /bin/clang++-fpchecker: -------------------------------------------------------------------------------- 1 | /usr/workspace/wsa/laguna/fpchecker/FPChecker/cpu_checking/clang_fpchecker.py -------------------------------------------------------------------------------- /bin/clang-fpchecker: -------------------------------------------------------------------------------- 1 | /usr/workspace/wsa/laguna/fpchecker/FPChecker/cpu_checking/clang_fpchecker.py -------------------------------------------------------------------------------- /bin/fpc-create-report: -------------------------------------------------------------------------------- 1 | /usr/workspace/wsa/laguna/fpchecker/FPChecker/cpu_checking/fpc_create_report.py -------------------------------------------------------------------------------- /bin/fpc-debug: -------------------------------------------------------------------------------- 1 | /usr/workspace/wsa/laguna/fpchecker/FPChecker/parser/fpc-debug.py -------------------------------------------------------------------------------- /bin/fpc-report: -------------------------------------------------------------------------------- 1 | /usr/workspace/wsa/laguna/fpchecker/FPChecker/parser/fpc-debug.py -------------------------------------------------------------------------------- /bin/fpchecker: -------------------------------------------------------------------------------- 1 | /usr/workspace/wsa/laguna/fpchecker/FPChecker/interception_tool/fpchecker.py -------------------------------------------------------------------------------- /bin/g++-fpc: -------------------------------------------------------------------------------- 1 | /usr/workspace/wsa/laguna/fpchecker/FPChecker/parser/g++_fpchecker.py -------------------------------------------------------------------------------- /bin/mpiCC-fpchecker: -------------------------------------------------------------------------------- 1 | /usr/workspace/wsa/laguna/fpchecker/FPChecker/cpu_checking/mpicc_fpchecker.py -------------------------------------------------------------------------------- /bin/mpic++-fpchecker: -------------------------------------------------------------------------------- 1 | /usr/workspace/wsa/laguna/fpchecker/FPChecker/cpu_checking/mpicc_fpchecker.py -------------------------------------------------------------------------------- /bin/mpicc-fpchecker: -------------------------------------------------------------------------------- 1 | /usr/workspace/wsa/laguna/fpchecker/FPChecker/cpu_checking/mpicc_fpchecker.py -------------------------------------------------------------------------------- /bin/mpiclang++-fpchecker: -------------------------------------------------------------------------------- 1 | /usr/workspace/wsa/laguna/fpchecker/FPChecker/cpu_checking/mpicc_fpchecker.py -------------------------------------------------------------------------------- /bin/mpiclang-fpchecker: -------------------------------------------------------------------------------- 1 | /usr/workspace/wsa/laguna/fpchecker/FPChecker/cpu_checking/mpicc_fpchecker.py -------------------------------------------------------------------------------- /bin/mpicxx-fpchecker: -------------------------------------------------------------------------------- 1 | /usr/workspace/wsa/laguna/fpchecker/FPChecker/cpu_checking/mpicc_fpchecker.py -------------------------------------------------------------------------------- /bin/mpig++-fpchecker: -------------------------------------------------------------------------------- 1 | /usr/workspace/wsa/laguna/fpchecker/FPChecker/cpu_checking/mpicc_fpchecker.py -------------------------------------------------------------------------------- /bin/mpigcc-fpchecker: -------------------------------------------------------------------------------- 1 | /usr/workspace/wsa/laguna/fpchecker/FPChecker/cpu_checking/mpicc_fpchecker.py -------------------------------------------------------------------------------- /bin/nvcc-fpc: -------------------------------------------------------------------------------- 1 | /usr/workspace/wsa/laguna/fpchecker/FPChecker/parser/nvcc_fpchecker.py -------------------------------------------------------------------------------- /cpu_checking/cc_frontend.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export FPC_COMPILER='clang' 4 | export FPC_COMPILER_PARAMS=`printf "%q " "$@"` 5 | DIR=`dirname $0` 6 | exec "$DIR/../cpu_checking/clang_fpchecker.py" 7 | -------------------------------------------------------------------------------- /cpu_checking/cc_mpi_frontend.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export FPC_COMPILER='mpicc' 4 | export FPC_COMPILER_PARAMS=`printf "%q " "$@"` 5 | DIR=`dirname $0` 6 | exec "$DIR/../cpu_checking/mpicc_fpchecker.py" 7 | -------------------------------------------------------------------------------- /cpu_checking/colors.py: -------------------------------------------------------------------------------- 1 | def prGreen(skk): 2 | print("\033[92m{}\033[00m" .format(skk)) 3 | 4 | def prCyan(skk): 5 | print("\033[96m{}\033[00m" .format(skk)) 6 | 7 | def prRed(skk): 8 | print("\033[91m{}\033[00m" .format(skk)) 9 | 10 | 11 | -------------------------------------------------------------------------------- /cpu_checking/cxx_frontend.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export FPC_COMPILER='clang++' 4 | export FPC_COMPILER_PARAMS=`printf "%q " "$@"` 5 | DIR=`dirname $0` 6 | exec "$DIR/../cpu_checking/clang_fpchecker.py" 7 | -------------------------------------------------------------------------------- /cpu_checking/cxx_mpi_frontend.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export FPC_COMPILER='mpicxx' 4 | export FPC_COMPILER_PARAMS=`printf "%q " "$@"` 5 | DIR=`dirname $0` 6 | exec "$DIR/../cpu_checking/mpicc_fpchecker.py" 7 | -------------------------------------------------------------------------------- /cpu_checking/exceptions.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | class FPCheckerException(Exception): 4 | pass 5 | 6 | class TokenException(FPCheckerException): 7 | pass 8 | 9 | class MatchException(FPCheckerException): 10 | pass 11 | 12 | class CommandException(FPCheckerException): 13 | pass 14 | 15 | class CompileException(FPCheckerException): 16 | pass 17 | 18 | class EmptyFileException(FPCheckerException): 19 | pass 20 | 21 | class DepreprocessorException(FPCheckerException): 22 | pass 23 | -------------------------------------------------------------------------------- /cpu_checking/fpc_logging.py: -------------------------------------------------------------------------------- 1 | 2 | import os 3 | from colors import prRed, prGreen 4 | 5 | def verbose() -> bool: 6 | if 'FPC_VERBOSE' in os.environ: 7 | return True 8 | return False 9 | 10 | ## Saves message in log file 11 | def logMessage(msg: str): 12 | with open('.fpc_log.txt', 'a') as fd: 13 | fd.write(msg + '\n') 14 | 15 | -------------------------------------------------------------------------------- /cpu_checking/histograms/report_templates/icons/logo_fpchecker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/cpu_checking/histograms/report_templates/icons/logo_fpchecker.png -------------------------------------------------------------------------------- /cpu_checking/histograms/report_templates/sample_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/cpu_checking/histograms/report_templates/sample_plot.png -------------------------------------------------------------------------------- /cpu_checking/report_templates/icons/logo_fpchecker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/cpu_checking/report_templates/icons/logo_fpchecker.png -------------------------------------------------------------------------------- /cpu_checking/report_templates/icons/underflow.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cpu_checking/report_templates/icons_3/logo_fpchecker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/cpu_checking/report_templates/icons_3/logo_fpchecker.png -------------------------------------------------------------------------------- /figures/logo_fpchecker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/figures/logo_fpchecker.png -------------------------------------------------------------------------------- /fpc_spack_repo/repo.yaml: -------------------------------------------------------------------------------- 1 | repo: 2 | namespace: 'fpc_spack_repo' 3 | -------------------------------------------------------------------------------- /interception_tool/colors.py: -------------------------------------------------------------------------------- 1 | def prGreen(skk): 2 | print("\033[92m{}\033[00m" .format(skk)) 3 | 4 | def prCyan(skk): 5 | print("\033[96m{}\033[00m" .format(skk)) 6 | 7 | def prRed(skk): 8 | print("\033[91m{}\033[00m" .format(skk)) 9 | 10 | 11 | -------------------------------------------------------------------------------- /interception_tool/intercept.h.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ifndef INTERCEPT_H 4 | #define INTERCEPT_H 5 | 6 | #cmakedefine NVCC_WRAPPER "@NVCC_WRAPPER@" 7 | #cmakedefine CLANG_WRAPPER "@CLANG_WRAPPER@" 8 | #cmakedefine CLANGPP_WRAPPER "@CLANGPP_WRAPPER@" 9 | #cmakedefine MPI_WRAPPER "@MPI_WRAPPER@" 10 | #cmakedefine MPIPP_WRAPPER "@MPIPP_WRAPPER@" 11 | 12 | #endif /* INTERCEPT_H */ 13 | 14 | -------------------------------------------------------------------------------- /interception_tool/makefile: -------------------------------------------------------------------------------- 1 | 2 | 3 | all: 4 | cc -std=c99 -o intercept.so -shared intercept.c -Wall -fPIC -g -ldl 5 | 6 | clean: 7 | rm -rf *.so 8 | -------------------------------------------------------------------------------- /lib: -------------------------------------------------------------------------------- 1 | /usr/workspace/wsa/laguna/fpchecker/FPChecker/build -------------------------------------------------------------------------------- /limitations.md: -------------------------------------------------------------------------------- 1 | 2 | ## Limitations of the CUDA Front-End 3 | 4 | The FPChecker CUDA fron-end is work-in-progress and has some limitations: 5 | - It doesn't instrument header files (only source files: .cu, .cpp, .c++, etc.) 6 | - It requires using C++11 7 | - The capabilities to parse macros and commets is good, but not perfect yet. 8 | -------------------------------------------------------------------------------- /parser/colors.py: -------------------------------------------------------------------------------- 1 | def prGreen(skk): 2 | print("\033[92m{}\033[00m" .format(skk)) 3 | 4 | def prCyan(skk): 5 | print("\033[96m{}\033[00m" .format(skk)) 6 | 7 | def prRed(skk): 8 | print("\033[91m{}\033[00m" .format(skk)) 9 | 10 | 11 | -------------------------------------------------------------------------------- /parser/exceptions.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | class FPCheckerException(Exception): 4 | pass 5 | 6 | class TokenException(FPCheckerException): 7 | pass 8 | 9 | class MatchException(FPCheckerException): 10 | pass 11 | 12 | class CommandException(FPCheckerException): 13 | pass 14 | 15 | class CompileException(FPCheckerException): 16 | pass 17 | 18 | class EmptyFileException(FPCheckerException): 19 | pass 20 | 21 | class DepreprocessorException(FPCheckerException): 22 | pass 23 | -------------------------------------------------------------------------------- /parser/fpc_logging.py: -------------------------------------------------------------------------------- 1 | 2 | import os 3 | from colors import prRed, prGreen 4 | 5 | def verbose() -> bool: 6 | if 'FPC_VERBOSE' in os.environ: 7 | return True 8 | return False 9 | 10 | ## Saves message in log file 11 | def logMessage(msg: str): 12 | with open('.fpc_log.txt', 'a') as fd: 13 | fd.write(msg + '\n') 14 | 15 | -------------------------------------------------------------------------------- /parser/test.ini: -------------------------------------------------------------------------------- 1 | ; The following lines are not instrumented 2 | [omit] 3 | omit_lines = file1.cu:10-20, compute.cu:30-35, compute.cu:42-46, 4 | foo.cpp:2-46, bar.cpp:1-10 5 | -------------------------------------------------------------------------------- /plugin/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.config 2 | 3 | PROG = libfpchecker_plugin.so 4 | SRC_FILES = instrumentation_plugin.cpp 5 | 6 | O_FILES = $(SRC_FILES:%.cpp=%.o) 7 | 8 | all: $(PROG) 9 | 10 | $(PROG): $(O_FILES) 11 | $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $(PROG) $(SHARED_LIB_OPT) $(O_FILES) 12 | 13 | clean: 14 | $(RM) *.o $(PROG) 15 | -------------------------------------------------------------------------------- /src/Logging.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Logging.h 3 | * 4 | * Created on: Feb 4, 2019 5 | * Author: Ignacio Laguna, ilaguna@llnl.gov 6 | */ 7 | 8 | #ifndef SRC_LOGGING_H_ 9 | #define SRC_LOGGING_H_ 10 | 11 | namespace CUDAAnalysis { 12 | 13 | #define FPC_PREFIX "#FPCHECKER: " 14 | 15 | class Logging 16 | { 17 | 18 | public: 19 | static void info(const char *msg); 20 | static void error(const char *msg); 21 | }; 22 | 23 | } 24 | 25 | 26 | 27 | 28 | #endif /* SRC_LOGGING_H_ */ 29 | -------------------------------------------------------------------------------- /tests/clang_plugin/dynamic/test_fp32_overflow_found/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(float a, float b, float *res); 4 | 5 | __global__ void dot_prod(float *x, float *y, int size); 6 | -------------------------------------------------------------------------------- /tests/clang_plugin/dynamic/test_fp64_almost_overflow_found_dont_abort/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(double a, double b, double *res); 4 | 5 | __global__ void dot_prod(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tests/clang_plugin/dynamic/test_fp64_almost_underflow_found/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(double a, double b, double *res); 4 | 5 | __global__ void dot_prod(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tests/clang_plugin/dynamic/test_fp64_almost_underflow_found_dont_abort/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(double a, double b, double *res); 4 | 5 | __global__ void dot_prod(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tests/clang_plugin/dynamic/test_fp64_flags/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(double a, double b, double *res); 4 | 5 | __global__ void dot_prod(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tests/clang_plugin/dynamic/test_fp64_nan_found/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(double a, double b, double *res); 4 | 5 | __global__ void dot_prod(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tests/clang_plugin/dynamic/test_fp64_nan_found_dont_abort/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(double a, double b, double *res); 4 | 5 | __global__ void dot_prod(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tests/clang_plugin/dynamic/test_fp64_overflow_found/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(double a, double b, double *res); 4 | 5 | __global__ void dot_prod(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tests/clang_plugin/dynamic/test_fp64_overflow_found_dont_abort/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(double a, double b, double *res); 4 | 5 | __global__ void dot_prod(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tests/clang_plugin/dynamic/test_fp64_underflow_found/compute.h: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | __device__ 5 | double power(double x); 6 | 7 | __global__ 8 | void compute(double x); 9 | -------------------------------------------------------------------------------- /tests/clang_plugin/dynamic/test_fp64_underflow_found/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(double a, double b, double *res); 4 | 5 | __global__ void dot_prod(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tests/clang_plugin/dynamic/test_fp64_underflow_found_dont_abort/compute.h: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | __device__ 5 | double power(double x); 6 | 7 | __global__ 8 | void compute(double x); 9 | -------------------------------------------------------------------------------- /tests/clang_plugin/dynamic/test_fp64_underflow_found_dont_abort/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(double a, double b, double *res); 4 | 5 | __global__ void dot_prod(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tests/clang_plugin/dynamic/test_host_fp32_overflow_found/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __host__ void mul(float a, float b, float *res); 4 | 5 | __host__ void dot_prod(float *x, float *y, int size); 6 | -------------------------------------------------------------------------------- /tests/clang_plugin/dynamic/test_host_fp64_nan_found/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __host__ void mul(double a, double b, double *res); 4 | 5 | __host__ void dot_prod(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tests/clang_plugin/dynamic/test_host_fp64_overflow_found/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __host__ void mul(double a, double b, double *res); 4 | 5 | __host__ void dot_prod(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tests/clang_plugin/dynamic/test_host_fp64_underflow_found/compute.h: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | __device__ 5 | double power(double x); 6 | 7 | __global__ 8 | void compute(double x); 9 | -------------------------------------------------------------------------------- /tests/clang_plugin/dynamic/test_host_fp64_underflow_found/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __host__ void mul(double a, double b, double *res); 4 | 5 | __host__ void dot_prod(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tests/clang_plugin/static/test_already_instrumented/Makefile.0: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP_LEVEL = -O0 4 | OP = $(CLANG_PASS) -emit-llvm -x cuda -nocudalib --cuda-gpu-arch=sm_60 -g $(OP_LEVEL) 5 | 6 | LINK = -L${CUDA_PATH}/lib64/ -lcuda -lcudart 7 | 8 | all: 9 | #cp -rf compute.cu.orig compute.cu 10 | $(CC) -c compute.cu $(OP) 11 | 12 | clean: 13 | rm -rf *.o __pycache__ *.cu 14 | -------------------------------------------------------------------------------- /tests/clang_plugin/static/test_comp_assignment/Makefile.0: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP_LEVEL = -O0 4 | OP = $(CLANG_PASS) -emit-llvm -x cuda -nocudalib --cuda-gpu-arch=sm_60 -g $(OP_LEVEL) 5 | 6 | LINK = -L${CUDA_PATH}/lib64/ -lcuda -lcudart 7 | 8 | all: 9 | cp -rf compute.cu.orig compute.cu 10 | $(CC) -c compute.cu $(OP) 11 | 12 | clean: 13 | rm -rf *.o __pycache__ *.cu 14 | -------------------------------------------------------------------------------- /tests/clang_plugin/static/test_comp_assignment/compute.cu.orig: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | __device__ 5 | double compute(double x) 6 | { 7 | double y = 0.0; 8 | y += (x+1.25)*10.0; 9 | return y; 10 | } 11 | 12 | -------------------------------------------------------------------------------- /tests/clang_plugin/static/test_constant_expressions/Makefile.0: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP_LEVEL = -O0 4 | OP = $(CLANG_PASS) -emit-llvm -x cuda -nocudalib --cuda-gpu-arch=sm_60 -g $(OP_LEVEL) 5 | 6 | LINK = -L${CUDA_PATH}/lib64/ -lcuda -lcudart 7 | 8 | all: 9 | cp -rf compute.cu.orig compute.cu 10 | $(CC) -c compute.cu $(OP) 11 | nvcc $(INC_RUNTIME_PLUGIN) -arch=sm_60 -c compute.cu 12 | 13 | clean: 14 | rm -rf *.o __pycache__ *.cu 15 | -------------------------------------------------------------------------------- /tests/clang_plugin/static/test_constant_expressions/compute.cu.orig: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | __device__ 5 | double compute(double x) 6 | { 7 | double y; 8 | double z; 9 | 10 | y = 0.0; 11 | z = 0; 12 | 13 | return y+z; 14 | } 15 | 16 | -------------------------------------------------------------------------------- /tests/clang_plugin/static/test_declarations/Makefile.0: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP_LEVEL = -O0 4 | OP = $(CLANG_PASS) -emit-llvm -x cuda -nocudalib --cuda-gpu-arch=sm_60 -g $(OP_LEVEL) 5 | 6 | LINK = -L${CUDA_PATH}/lib64/ -lcuda -lcudart 7 | 8 | all: 9 | cp -rf compute.cu.orig compute.cu 10 | $(CC) -c compute.cu $(OP) 11 | 12 | clean: 13 | rm -rf *.o __pycache__ *.cu 14 | -------------------------------------------------------------------------------- /tests/clang_plugin/static/test_declarations/compute.cu.orig: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | __device__ 5 | double compute(double x) 6 | { 7 | double y = x / (x + 1.3); 8 | return y; 9 | } 10 | 11 | -------------------------------------------------------------------------------- /tests/clang_plugin/static/test_host_device/Makefile.0: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP_LEVEL = -O0 4 | OP = $(CLANG_PASS) -emit-llvm -x cuda -nocudalib --cuda-gpu-arch=sm_60 -g $(OP_LEVEL) 5 | 6 | LINK = -L${CUDA_PATH}/lib64/ -lcuda -lcudart 7 | 8 | all: 9 | cp -rf compute.cu.orig compute.cu 10 | $(CC) -c compute.cu $(OP) 11 | 12 | clean: 13 | rm -rf *.o __pycache__ *.cu 14 | -------------------------------------------------------------------------------- /tests/clang_plugin/static/test_host_device/compute.cu.orig: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | __device__ 5 | double compute(double x) 6 | { 7 | double y = 0.0; 8 | y += (x+1.25)*10.0; 9 | return y; 10 | } 11 | 12 | __host__ __device__ 13 | void bar(double *x) 14 | { 15 | *x = *x / 1.2; 16 | } 17 | 18 | __host__ 19 | void foo(double *x) 20 | { 21 | *x = (*x - 128.0) / (*x); 22 | } 23 | 24 | __global__ 25 | void kernel1(double *x, double *y) 26 | { 27 | *x = (64+*y) * (*x); 28 | return; 29 | } 30 | -------------------------------------------------------------------------------- /tests/clang_plugin/static/test_integer_types/Makefile.0: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP_LEVEL = -O0 4 | OP = $(CLANG_PASS) -emit-llvm -x cuda -nocudalib --cuda-gpu-arch=sm_60 -g $(OP_LEVEL) 5 | 6 | LINK = -L${CUDA_PATH}/lib64/ -lcuda -lcudart 7 | 8 | all: 9 | cp -rf compute.cu.orig compute.cu 10 | $(CC) -c compute.cu $(OP) 11 | 12 | clean: 13 | rm -rf *.o __pycache__ *.cu 14 | -------------------------------------------------------------------------------- /tests/clang_plugin/static/test_integer_types/compute.cu.orig: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | __device__ 5 | double compute(double x) 6 | { 7 | double y = 0.0, z = 2.0; 8 | y += (x + (int)128); // should be instrumented 9 | int r = 3; 10 | r = r*((int)y); // should not be instrumented 11 | 12 | return y+r; 13 | } 14 | 15 | -------------------------------------------------------------------------------- /tests/clang_plugin/static/test_make_nested_dirs/Makefile.0: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP_LEVEL = -O0 4 | OP = $(CLANG_PASS) -emit-llvm -x cuda -nocudalib --cuda-gpu-arch=sm_60 -g $(OP_LEVEL) 5 | 6 | LINK = -L${CUDA_PATH}/lib64/ -lcuda -lcudart 7 | 8 | all: 9 | cp -rf src/src/compute.cu.orig src/src/compute.cu 10 | $(CC) -c src/src/compute.cu $(OP) 11 | 12 | clean: 13 | rm -rf *.o __pycache__ *.cu 14 | -------------------------------------------------------------------------------- /tests/clang_plugin/static/test_make_nested_dirs/src/src/compute.cu: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | __device__ 5 | double compute(double x) 6 | { 7 | double y = _FPC_CHECK_(x / (x + 1.3), 7, "src/src/compute.cu"); 8 | return y; 9 | } 10 | 11 | -------------------------------------------------------------------------------- /tests/clang_plugin/static/test_make_nested_dirs/src/src/compute.cu.orig: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | __device__ 5 | double compute(double x) 6 | { 7 | double y = x / (x + 1.3); 8 | return y; 9 | } 10 | 11 | -------------------------------------------------------------------------------- /tests/clang_plugin/static/test_multi_lines/Makefile.0: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP_LEVEL = -O0 4 | OP = $(CLANG_PASS) -emit-llvm -x cuda -nocudalib --cuda-gpu-arch=sm_60 -g $(OP_LEVEL) 5 | 6 | LINK = -L${CUDA_PATH}/lib64/ -lcuda -lcudart 7 | 8 | all: 9 | cp -rf compute.cu.orig compute.cu 10 | $(CC) -c compute.cu $(OP) 11 | 12 | clean: 13 | rm -rf *.o __pycache__ *.cu 14 | -------------------------------------------------------------------------------- /tests/clang_plugin/static/test_multi_lines/compute.cu.orig: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | __device__ 5 | double compute(double x) 6 | { 7 | double y = 0.0, z = 2.0; 8 | y += (x+ 9 | 1.25 ) * 10 | 10.0; z = 11 | y + x; 12 | return y; 13 | } 14 | 15 | -------------------------------------------------------------------------------- /tests/clang_plugin/static/test_pointer_expressions/Makefile.0: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP_LEVEL = -O0 4 | OP = $(CLANG_PASS) -emit-llvm -x cuda -nocudalib --cuda-gpu-arch=sm_60 -g $(OP_LEVEL) 5 | 6 | LINK = -L${CUDA_PATH}/lib64/ -lcuda -lcudart 7 | 8 | all: 9 | cp -rf compute.cu.orig compute.cu 10 | $(CC) -c compute.cu $(OP) 11 | nvcc $(INC_RUNTIME_PLUGIN) -arch=sm_60 -c compute.cu 12 | 13 | clean: 14 | rm -rf *.o __pycache__ *.cu 15 | -------------------------------------------------------------------------------- /tests/clang_plugin/static/test_simple_lambda/Makefile.0: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP_LEVEL = -O0 4 | OP = $(CLANG_PASS) -std=c++11 -emit-llvm -x cuda -nocudalib --cuda-gpu-arch=sm_60 -g $(OP_LEVEL) 5 | 6 | LINK = -L${CUDA_PATH}/lib64/ -lcuda -lcudart 7 | 8 | all: 9 | cp -rf compute.cpp.orig compute.cpp 10 | $(CC) $(OP) -c compute.cpp 11 | 12 | clean: 13 | rm -rf *.o __pycache__ *.cu *.cpp 14 | -------------------------------------------------------------------------------- /tests/clang_plugin/static/test_simple_lambda/compute.cpp.orig: -------------------------------------------------------------------------------- 1 | 2 | void comp() 3 | { 4 | 5 | double x = 9.0; 6 | double y = 10.3; 7 | auto sum = [] __device__ (double x, double y) -> double { 8 | double z = x + y; 9 | x = y; 10 | return x / 2.29; 11 | }; 12 | 13 | double *r; 14 | r[2] = x; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /tests/clang_plugin/static/test_static_initialization/Makefile.0: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP_LEVEL = -O0 4 | OP = $(CLANG_PASS) -emit-llvm -x cuda -nocudalib --cuda-gpu-arch=sm_60 -g $(OP_LEVEL) 5 | 6 | LINK = -L${CUDA_PATH}/lib64/ -lcuda -lcudart 7 | 8 | all: 9 | cp -rf compute.cu.orig compute.cu 10 | $(CC) -c compute.cu $(OP) 11 | 12 | clean: 13 | rm -rf *.o __pycache__ *.cu 14 | -------------------------------------------------------------------------------- /tests/clang_plugin/static/test_static_initialization/compute.cu.orig: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | 5 | 6 | class Box { 7 | public: 8 | static double energy; 9 | Box(); 10 | double getEnergy() const 11 | { 12 | return energy + 10.5; 13 | } 14 | }; 15 | 16 | // this should not be instrumented 17 | double Box::energy = 3.25; 18 | 19 | __device__ 20 | double compute(double x) 21 | { 22 | double y = 0.0; 23 | y += (x + (int)128); // should be instrumented 24 | return y; 25 | } 26 | 27 | -------------------------------------------------------------------------------- /tests/clang_plugin/static/test_two_compilations/Makefile.0: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP_LEVEL = -O0 4 | OP = $(CLANG_PASS) -emit-llvm -x cuda -nocudalib --cuda-gpu-arch=sm_60 -g $(OP_LEVEL) 5 | 6 | LINK = -L${CUDA_PATH}/lib64/ -lcuda -lcudart 7 | 8 | all: 9 | cp -rf compute.cu.orig compute.cu 10 | $(CC) $(OP) -c compute.cu 11 | $(CC) $(OP) -c compute.cu 12 | 13 | clean: 14 | rm -rf *.o __pycache__ *.cu 15 | -------------------------------------------------------------------------------- /tests/clang_plugin/static/test_two_compilations/compute.cu.orig: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | __device__ 5 | double compute(double x) 6 | { 7 | double y = x / (x + 1.3); 8 | return y; 9 | } 10 | 11 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/cpu_checking/dynamic/__init__.py -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_c_and_cpp/Makefile: -------------------------------------------------------------------------------- 1 | 2 | OP = -O2 3 | CXX = FPC_INSTRUMENT=1 clang++-fpchecker 4 | CC = FPC_INSTRUMENT=1 clang-fpchecker 5 | 6 | all: 7 | $(CXX) -c main.cpp $(OP) 8 | $(CXX) -c compute.cpp $(OP) 9 | $(CC) -c compute_2.c $(OP) 10 | $(CXX) -o main compute.o compute_2.o main.o 11 | 12 | clean: 13 | rm -rf *.o main __pycache__ .fpc_logs .fpc_log.txt 14 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_c_and_cpp/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/cpu_checking/dynamic/test_c_and_cpp/__init__.py -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_c_and_cpp/compute.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "compute.h" 3 | #include "compute_2.h" 4 | #include 5 | 6 | double compute(double *x, int n) { 7 | double res = 0.0; 8 | for (int i=0; i < n; ++i) { 9 | res = res + x[i]; 10 | res = mult(res, res); 11 | 12 | // NaN 13 | res = (res-res) / (res-res); 14 | } 15 | return res; 16 | } 17 | 18 | 19 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_c_and_cpp/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | double compute(double *x, int n); 4 | 5 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_c_and_cpp/compute_2.c: -------------------------------------------------------------------------------- 1 | 2 | double mult(double x, double y) { 3 | return x*y; 4 | } 5 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_c_and_cpp/compute_2.h: -------------------------------------------------------------------------------- 1 | 2 | extern "C" { 3 | double mult(double x, double y); 4 | } 5 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_c_and_cpp/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include "compute.h" 5 | 6 | int main(int argc, char **argv) 7 | { 8 | int n = 8; 9 | int nbytes = n*sizeof(double); 10 | double *data = (double *)malloc(nbytes); 11 | for (int i=0; i < n; ++i) 12 | data[i] = (double)(i+1); 13 | printf("Calling kernel\n"); 14 | double result = compute(data, n); 15 | printf("Result: %f\n", result); 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_clang_interceptor/Makefile: -------------------------------------------------------------------------------- 1 | 2 | OP = -O2 3 | CXX = clang++ 4 | 5 | all: 6 | $(CXX) -c main.cpp $(OP) 7 | $(CXX) -c compute.cpp $(OP) 8 | $(CXX) -o main compute.o main.o 9 | 10 | clean: 11 | rm -rf *.o main __pycache__ .fpc_logs .fpc_log.txt 12 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_clang_interceptor/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/cpu_checking/dynamic/test_clang_interceptor/__init__.py -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_clang_interceptor/compute.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | double compute(double *x, int n) { 5 | double res = 0.0; 6 | for (int i=0; i < n; ++i) { 7 | res = res + x[i]; 8 | 9 | // NaN 10 | res = (res-res) / (res-res); 11 | } 12 | return res; 13 | } 14 | 15 | 16 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_clang_interceptor/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | double compute(double *x, int n); 4 | 5 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_clang_interceptor/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include "compute.h" 5 | 6 | int main(int argc, char **argv) 7 | { 8 | int n = 8; 9 | int nbytes = n*sizeof(double); 10 | double *data = (double *)malloc(nbytes); 11 | for (int i=0; i < n; ++i) 12 | data[i] = (double)(i+1); 13 | printf("Calling kernel\n"); 14 | double result = compute(data, n); 15 | printf("Result: %f\n", result); 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_cmake_multidir/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION "3.9.1") 2 | 3 | project("server") 4 | 5 | add_subdirectory(src) 6 | 7 | #add_executable("${PROJECT_NAME}" "src/main.cpp") 8 | 9 | #install(TARGETS "${PROJECT_NAME}" DESTINATION bin) 10 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_cmake_multidir/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/cpu_checking/dynamic/test_cmake_multidir/__init__.py -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_cmake_multidir/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION "3.9.1") 2 | project(main_exe) 3 | 4 | add_subdirectory(util) 5 | add_subdirectory(core) 6 | 7 | include_directories(util core) 8 | 9 | set(main_source_files main.cpp) 10 | add_executable(main_program ${main_source_files}) 11 | 12 | target_link_libraries(main_program server) 13 | # also transitively gets the "js" and "util" dependencies 14 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_cmake_multidir/src/core/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | set(server_source_files 3 | server.cpp 4 | server.h 5 | ) 6 | add_library(server ${server_source_files}) 7 | 8 | target_link_libraries(server util) 9 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_cmake_multidir/src/core/server.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "server.h" 3 | 4 | double server_compute(double x, double y) { 5 | return x*y; 6 | } 7 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_cmake_multidir/src/core/server.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | double server_compute(double x, double y); 4 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_cmake_multidir/src/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include "util.h" 4 | #include "server.h" 5 | 6 | int main() { 7 | double x = 1.3; 8 | double y = 10.0; 9 | double tmp = compute_util(x, y); 10 | tmp = server_compute(tmp, y); 11 | 12 | printf("simple program: %f\n", tmp); 13 | 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_cmake_multidir/src/util/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | set(util_source_files 3 | util.cpp 4 | util.h 5 | ) 6 | 7 | add_library(util ${util_source_files}) 8 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_cmake_multidir/src/util/util.cpp: -------------------------------------------------------------------------------- 1 | 2 | 3 | #include "util.h" 4 | 5 | double compute_util(double x, double y) { 6 | return x+y; 7 | } 8 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_cmake_multidir/src/util/util.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | double compute_util(double x, double y); 4 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_conditional_operations/Makefile.1: -------------------------------------------------------------------------------- 1 | 2 | OP = -O3 3 | #CXX = FPC_INSTRUMENT=1 clang++-fpchecker 4 | CXX = clang++ 5 | 6 | all: 7 | $(CXX) -c main.cpp $(OP) 8 | $(CXX) -c compute.cpp $(OP) 9 | $(CXX) -o main compute.o main.o 10 | 11 | clean: 12 | rm -rf *.o main __pycache__ .fpc_logs 13 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_conditional_operations/Makefile.2: -------------------------------------------------------------------------------- 1 | 2 | OP = -O3 -DINVERSE 3 | CXX = FPC_INSTRUMENT=1 clang++-fpchecker 4 | 5 | all: 6 | $(CXX) -c main.cpp $(OP) 7 | $(CXX) -c compute.cpp $(OP) 8 | $(CXX) -o main compute.o main.o 9 | 10 | clean: 11 | rm -rf *.o main __pycache__ .fpc_logs 12 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_conditional_operations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/cpu_checking/dynamic/test_conditional_operations/__init__.py -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_conditional_operations/compute.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | double compute(double *x, int n) { 5 | 6 | #ifndef INVERSE 7 | if (x[1]) 8 | x[0] = -1.0/x[1]; 9 | else 10 | x[0] = 0.0; 11 | #else 12 | if (x[1] < 1.0) 13 | x[0] = 0.0; 14 | else 15 | x[0] = -1.0/x[1]; 16 | #endif 17 | 18 | return x[0]; 19 | } 20 | 21 | 22 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_conditional_operations/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | double compute(double *x, int n); 4 | 5 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_conditional_operations/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include 5 | #include "compute.h" 6 | 7 | int main(int argc, char **argv) 8 | { 9 | double *data = (double *)malloc(sizeof(double) * 4); 10 | data[0] = 1.0; 11 | data[1] = 0.0; 12 | data[2] = 2.0; 13 | data[3] = 3.0; 14 | 15 | printf("Calling kernel\n"); 16 | compute(data, 3); 17 | printf("Result: %f\n", data[0]); 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fast_checking/Makefile: -------------------------------------------------------------------------------- 1 | 2 | OP = -O2 #-DFPC_FAST_CHECKING 3 | CXX = FPC_INSTRUMENT=1 clang++-fpchecker 4 | 5 | all: 6 | $(CXX) -c main.cpp $(OP) 7 | $(CXX) -c compute.cpp $(OP) 8 | $(CXX) -o main compute.o main.o 9 | 10 | clean: 11 | rm -rf *.o main __pycache__ .fpc_logs .fpc_log.txt 12 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fast_checking/Makefile_fast: -------------------------------------------------------------------------------- 1 | 2 | OP = -O2 -DFPC_FAST_CHECKING 3 | CXX = FPC_INSTRUMENT=1 clang++-fpchecker 4 | 5 | all: 6 | $(CXX) -c main.cpp $(OP) 7 | $(CXX) -c compute.cpp $(OP) 8 | $(CXX) -o main compute.o main.o 9 | 10 | clean: 11 | rm -rf *.o main __pycache__ .fpc_logs .fpc_log.txt 12 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fast_checking/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/cpu_checking/dynamic/test_fast_checking/__init__.py -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fast_checking/compute.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | double compute(double *x, int n) { 5 | double res = 0.0; 6 | for (int i=0; i < n; ++i) { 7 | res = res + x[i]; 8 | 9 | // NaN 10 | res = (res-res) / (res-res); 11 | } 12 | 13 | if (res == 2.0) 14 | return res-1.0; 15 | 16 | return res; 17 | } 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fast_checking/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | double compute(double *x, int n); 4 | 5 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fast_checking/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include "compute.h" 5 | 6 | int main(int argc, char **argv) 7 | { 8 | int n = 8; 9 | int nbytes = n*sizeof(double); 10 | double *data = (double *)malloc(nbytes); 11 | for (int i=0; i < n; ++i) 12 | data[i] = (double)(i+1); 13 | printf("Calling kernel\n"); 14 | double result = compute(data, n); 15 | printf("Result: %f\n", result); 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_cancellation/Makefile: -------------------------------------------------------------------------------- 1 | 2 | OP = -O0 3 | CXX = FPC_INSTRUMENT=1 clang++-fpchecker 4 | 5 | all: 6 | $(CXX) -c main.cpp $(OP) 7 | $(CXX) -c compute.cpp $(OP) 8 | $(CXX) -o main compute.o main.o 9 | 10 | clean: 11 | rm -rf *.o main __pycache__ .fpc_logs .fpc_log.txt 12 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_cancellation/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/cpu_checking/dynamic/test_fp32_cancellation/__init__.py -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_cancellation/compute.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | float compute(float *x, int n) { 5 | float res = 0.0; 6 | for (int i=0; i < n; ++i) { 7 | //res = res + x[i]; 8 | 9 | // Cancellation 10 | float tmp = x[i] - (x[i]+0.0000000001); 11 | res += tmp; 12 | } 13 | return res; 14 | } 15 | 16 | 17 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_cancellation/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | float compute(float *x, int n); 4 | 5 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_cancellation/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include 5 | #include "compute.h" 6 | 7 | int main(int argc, char **argv) 8 | { 9 | int n = 8; 10 | int nbytes = n*sizeof(float); 11 | float *data = (float *)malloc(nbytes); 12 | for (int i=0; i < n; ++i) 13 | data[i] = (float)(pow(2,-i*2)); 14 | printf("Calling kernel\n"); 15 | float result = compute(data, n); 16 | printf("Result: %f\n", result); 17 | 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_comparison/Makefile: -------------------------------------------------------------------------------- 1 | 2 | OP = -O2 3 | CXX = FPC_INSTRUMENT=1 clang++-fpchecker 4 | 5 | all: 6 | $(CXX) -c main.cpp $(OP) 7 | $(CXX) -c compute.cpp $(OP) 8 | $(CXX) -o main compute.o main.o 9 | 10 | clean: 11 | rm -rf *.o main __pycache__ .fpc_logs .fpc_log.txt 12 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_comparison/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/cpu_checking/dynamic/test_fp32_comparison/__init__.py -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_comparison/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | float compute(float *x, int n); 4 | 5 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_comparison/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include "compute.h" 5 | 6 | int main(int argc, char **argv) 7 | { 8 | int n = 8; 9 | int nbytes = n*sizeof(float); 10 | float *data = (float *)malloc(nbytes); 11 | for (int i=0; i < n; ++i) 12 | data[i] = (float)(i+1); 13 | printf("Calling kernel\n"); 14 | float result = compute(data, n); 15 | printf("Result: %f\n", result); 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_division_zero/Makefile: -------------------------------------------------------------------------------- 1 | 2 | OP = -O2 3 | CXX = FPC_INSTRUMENT=1 clang++-fpchecker 4 | 5 | all: 6 | $(CXX) -c main.cpp $(OP) 7 | $(CXX) -c compute.cpp $(OP) 8 | $(CXX) -o main compute.o main.o 9 | 10 | clean: 11 | rm -rf *.o main __pycache__ .fpc_logs .fpc_log.txt 12 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_division_zero/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/cpu_checking/dynamic/test_fp32_division_zero/__init__.py -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_division_zero/compute.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | float compute(float *x, int n) { 5 | float res = 0.0f; 6 | for (int i=0; i < n; ++i) { 7 | res = res + x[i]; 8 | 9 | // Division by zero 10 | res = res / (res-res); 11 | } 12 | return res; 13 | } 14 | 15 | 16 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_division_zero/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | float compute(float *x, int n); 4 | 5 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_division_zero/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include "compute.h" 5 | 6 | int main(int argc, char **argv) 7 | { 8 | int n = 8; 9 | int nbytes = n*sizeof(float); 10 | float *data = (float *)malloc(nbytes); 11 | for (int i=0; i < n; ++i) 12 | data[i] = (float)(i+1); 13 | printf("Calling kernel\n"); 14 | float result = compute(data, n); 15 | printf("Result: %f\n", result); 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_histogram_for_events/Makefile: -------------------------------------------------------------------------------- 1 | 2 | OP = -O2 -DFPC_EXPONENT_USAGE 3 | CXX = FPC_INSTRUMENT=1 clang++-fpchecker 4 | 5 | all: 6 | $(CXX) -c main.cpp $(OP) 7 | $(CXX) -c compute.cpp $(OP) 8 | $(CXX) -o main compute.o main.o 9 | 10 | clean: 11 | rm -rf *.o main __pycache__ .fpc_logs .fpc_log.txt 12 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_histogram_for_events/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/cpu_checking/dynamic/test_fp32_histogram_for_events/__init__.py -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_histogram_traces/Makefile: -------------------------------------------------------------------------------- 1 | 2 | OP = -O2 -DFPC_EXPONENT_USAGE 3 | CXX = FPC_INSTRUMENT=1 clang++-fpchecker 4 | 5 | all: 6 | $(CXX) -c main.cpp $(OP) 7 | $(CXX) -c compute.cpp $(OP) 8 | $(CXX) -o main compute.o main.o 9 | 10 | clean: 11 | rm -rf *.o main __pycache__ .fpc_logs .fpc_log.txt fpc-report 12 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_histogram_traces/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/cpu_checking/dynamic/test_fp32_histogram_traces/__init__.py -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_histogram_traces/compute.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | float compute(float x, float y) { 5 | float res = x + y; 6 | return res; 7 | } 8 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_histogram_traces/compute.h: -------------------------------------------------------------------------------- 1 | float compute(float x, float y); 2 | 3 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_infinity_neg/Makefile: -------------------------------------------------------------------------------- 1 | 2 | OP = -O2 3 | CXX = FPC_INSTRUMENT=1 clang++-fpchecker #-DFPC_POSITIVE_OVERFLOW=1 4 | 5 | all: 6 | $(CXX) -c main.cpp $(OP) 7 | $(CXX) -c compute.cpp $(OP) 8 | $(CXX) -o main compute.o main.o 9 | 10 | clean: 11 | rm -rf *.o main __pycache__ .fpc_logs .fpc_log.txt 12 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_infinity_neg/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/cpu_checking/dynamic/test_fp32_infinity_neg/__init__.py -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_infinity_neg/compute.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | float compute(float *x, int n) { 5 | float res = 0.0; 6 | for (int i=0; i < n; ++i) { 7 | #ifdef FPC_POSITIVE_OVERFLOW 8 | res = res + x[i]; 9 | #else 10 | res = res - x[i]; 11 | #endif 12 | 13 | // Overflow 14 | res = res * (1e37 * 1e10); 15 | } 16 | return res; 17 | } 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_infinity_neg/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | float compute(float *x, int n); 4 | 5 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_infinity_neg/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include "compute.h" 5 | 6 | int main(int argc, char **argv) 7 | { 8 | int n = 8; 9 | int nbytes = n*sizeof(float); 10 | float *data = (float *)malloc(nbytes); 11 | for (int i=0; i < n; ++i) 12 | data[i] = (float)(i+1); 13 | printf("Calling kernel\n"); 14 | float result = compute(data, n); 15 | printf("Result: %f\n", result); 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_infinity_pos/Makefile: -------------------------------------------------------------------------------- 1 | 2 | OP = -O2 3 | CXX = FPC_INSTRUMENT=1 clang++-fpchecker -DFPC_POSITIVE_OVERFLOW=1 4 | 5 | all: 6 | $(CXX) -c main.cpp $(OP) 7 | $(CXX) -c compute.cpp $(OP) 8 | $(CXX) -o main compute.o main.o 9 | 10 | clean: 11 | rm -rf *.o main __pycache__ .fpc_logs .fpc_log.txt 12 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_infinity_pos/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/cpu_checking/dynamic/test_fp32_infinity_pos/__init__.py -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_infinity_pos/compute.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | float compute(float *x, int n) { 5 | float res = 0.0; 6 | for (int i=0; i < n; ++i) { 7 | #ifdef FPC_POSITIVE_OVERFLOW 8 | res = res + x[i]; 9 | #else 10 | res = res - x[i]; 11 | #endif 12 | 13 | // Overflow 14 | res = res * (1e37 * 1e10); 15 | } 16 | return res; 17 | } 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_infinity_pos/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | float compute(float *x, int n); 4 | 5 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_infinity_pos/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include "compute.h" 5 | 6 | int main(int argc, char **argv) 7 | { 8 | int n = 8; 9 | int nbytes = n*sizeof(float); 10 | float *data = (float *)malloc(nbytes); 11 | for (int i=0; i < n; ++i) 12 | data[i] = (float)(i+1); 13 | printf("Calling kernel\n"); 14 | float result = compute(data, n); 15 | printf("Result: %f\n", result); 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_latent_infinity_neg/Makefile: -------------------------------------------------------------------------------- 1 | 2 | OP = -O2 3 | CXX = FPC_INSTRUMENT=1 clang++-fpchecker 4 | 5 | all: 6 | $(CXX) -c main.cpp $(OP) 7 | $(CXX) -c compute.cpp $(OP) 8 | $(CXX) -o main compute.o main.o 9 | 10 | clean: 11 | rm -rf *.o main __pycache__ .fpc_logs 12 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_latent_infinity_neg/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/cpu_checking/dynamic/test_fp32_latent_infinity_neg/__init__.py -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_latent_infinity_neg/compute.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | float compute(float *x, int n) { 5 | float res = 0.0f; 6 | for (int i=0; i < n; ++i) { 7 | //res = res + x[i]; 8 | 9 | // Latent overflow 10 | res = x[i] * -1e+36f; 11 | } 12 | return res; 13 | } 14 | 15 | 16 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_latent_infinity_neg/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | float compute(float *x, int n); 4 | 5 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_latent_infinity_neg/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include "compute.h" 5 | 6 | int main(int argc, char **argv) 7 | { 8 | int n = 8; 9 | int nbytes = n*sizeof(float); 10 | float *data = (float *)malloc(nbytes); 11 | for (int i=0; i < n; ++i) 12 | data[i] = (float)(i+1); 13 | printf("Calling kernel\n"); 14 | float result = compute(data, n); 15 | printf("Result: %f\n", result); 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_latent_infinity_pos/Makefile: -------------------------------------------------------------------------------- 1 | 2 | OP = -O2 3 | CXX = FPC_INSTRUMENT=1 clang++-fpchecker 4 | 5 | all: 6 | $(CXX) -c main.cpp $(OP) 7 | $(CXX) -c compute.cpp $(OP) 8 | $(CXX) -o main compute.o main.o 9 | 10 | clean: 11 | rm -rf *.o main __pycache__ .fpc_logs 12 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_latent_infinity_pos/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/cpu_checking/dynamic/test_fp32_latent_infinity_pos/__init__.py -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_latent_infinity_pos/compute.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | float compute(float *x, int n) { 5 | float res = 0.0f; 6 | for (int i=0; i < n; ++i) { 7 | //res = res + x[i]; 8 | 9 | // Latent overflow 10 | res = x[i] * 1e+36f; 11 | } 12 | return res; 13 | } 14 | 15 | 16 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_latent_infinity_pos/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | float compute(float *x, int n); 4 | 5 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_latent_infinity_pos/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include "compute.h" 5 | 6 | int main(int argc, char **argv) 7 | { 8 | int n = 8; 9 | int nbytes = n*sizeof(float); 10 | float *data = (float *)malloc(nbytes); 11 | for (int i=0; i < n; ++i) 12 | data[i] = (float)(i+1); 13 | printf("Calling kernel\n"); 14 | float result = compute(data, n); 15 | printf("Result: %f\n", result); 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_latent_subnormal/Makefile: -------------------------------------------------------------------------------- 1 | 2 | OP = -O2 3 | CXX = FPC_INSTRUMENT=1 clang++-fpchecker 4 | 5 | all: 6 | $(CXX) -c main.cpp $(OP) 7 | $(CXX) -c compute.cpp $(OP) 8 | $(CXX) -o main compute.o main.o 9 | 10 | clean: 11 | rm -rf *.o main __pycache__ .fpc_logs 12 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_latent_subnormal/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/cpu_checking/dynamic/test_fp32_latent_subnormal/__init__.py -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_latent_subnormal/compute.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | float compute(float *x, int n) { 5 | float res = 0.0f; 6 | for (int i=0; i < n; ++i) { 7 | //res = res + x[i]; 8 | 9 | 10 | res = x[i] * (1e-36f); 11 | } 12 | return res; 13 | } 14 | 15 | 16 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_latent_subnormal/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | float compute(float *x, int n); 4 | 5 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_latent_subnormal/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include "compute.h" 5 | 6 | int main(int argc, char **argv) 7 | { 8 | int n = 8; 9 | int nbytes = n*sizeof(float); 10 | float *data = (float *)malloc(nbytes); 11 | for (int i=0; i < n; ++i) 12 | data[i] = (float)(i+1); 13 | printf("Calling kernel\n"); 14 | float result = compute(data, n); 15 | printf("Result: %f\n", result); 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_nan/Makefile: -------------------------------------------------------------------------------- 1 | 2 | OP = -O2 3 | CXX = FPC_INSTRUMENT=1 clang++-fpchecker 4 | 5 | all: 6 | $(CXX) -c main.cpp $(OP) 7 | $(CXX) -c compute.cpp $(OP) 8 | $(CXX) -o main compute.o main.o 9 | 10 | clean: 11 | rm -rf *.o main __pycache__ .fpc_logs .fpc_log.txt 12 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_nan/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/cpu_checking/dynamic/test_fp32_nan/__init__.py -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_nan/compute.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | float compute(float *x, int n) { 5 | float res = 0.0f; 6 | for (int i=0; i < n; ++i) { 7 | res = res + x[i]; 8 | 9 | // NaN 10 | res = (res-res) / (res-res); 11 | } 12 | return res; 13 | } 14 | 15 | 16 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_nan/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | float compute(float *x, int n); 4 | 5 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_nan/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include "compute.h" 5 | 6 | int main(int argc, char **argv) 7 | { 8 | int n = 8; 9 | int nbytes = n*sizeof(float); 10 | float *data = (float *)malloc(nbytes); 11 | for (int i=0; i < n; ++i) 12 | data[i] = (float)(i+1); 13 | printf("Calling kernel\n"); 14 | float result = compute(data, n); 15 | printf("Result: %f\n", result); 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_subnormal/Makefile: -------------------------------------------------------------------------------- 1 | 2 | OP = -O2 3 | CXX = FPC_INSTRUMENT=1 clang++-fpchecker 4 | 5 | all: 6 | $(CXX) -c main.cpp $(OP) 7 | $(CXX) -c compute.cpp $(OP) 8 | $(CXX) -o main compute.o main.o 9 | 10 | clean: 11 | rm -rf *.o main __pycache__ .fpc_logs 12 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_subnormal/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/cpu_checking/dynamic/test_fp32_subnormal/__init__.py -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_subnormal/compute.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | float compute(float *x, int n) { 5 | float res = 0.0f; 6 | for (int i=0; i < n; ++i) { 7 | res = res + x[i]; 8 | 9 | // subnormal 10 | res = res * (1e-38f * 1e-5f); 11 | } 12 | return res; 13 | } 14 | 15 | 16 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_subnormal/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | float compute(float *x, int n); 4 | 5 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_subnormal/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include "compute.h" 5 | 6 | int main(int argc, char **argv) 7 | { 8 | int n = 8; 9 | int nbytes = n*sizeof(float); 10 | float *data = (float *)malloc(nbytes); 11 | for (int i=0; i < n; ++i) 12 | data[i] = (float)(i+1); 13 | printf("Calling kernel\n"); 14 | float result = compute(data, n); 15 | printf("Result: %.12g\n", result); 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_cancellation/Makefile: -------------------------------------------------------------------------------- 1 | 2 | OP = -O0 3 | CXX = FPC_INSTRUMENT=1 clang++-fpchecker 4 | 5 | all: 6 | $(CXX) -c main.cpp $(OP) 7 | $(CXX) -c compute.cpp $(OP) 8 | $(CXX) -o main compute.o main.o 9 | 10 | clean: 11 | rm -rf *.o main __pycache__ .fpc_logs 12 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_cancellation/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/cpu_checking/dynamic/test_fp64_cancellation/__init__.py -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_cancellation/compute.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | double compute(double *x, int n) { 5 | double res = 0.0; 6 | for (int i=0; i < n; ++i) { 7 | //res = res + x[i]; 8 | 9 | // Cancellation 10 | double tmp = x[i] - (x[i]+0.0000000001); 11 | res += tmp; 12 | } 13 | return res; 14 | } 15 | 16 | 17 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_cancellation/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | double compute(double *x, int n); 4 | 5 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_cancellation/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include 5 | #include "compute.h" 6 | 7 | int main(int argc, char **argv) 8 | { 9 | int n = 8; 10 | int nbytes = n*sizeof(double); 11 | double *data = (double *)malloc(nbytes); 12 | for (int i=0; i < n; ++i) 13 | data[i] = (double)(pow(2,-i*2)); 14 | printf("Calling kernel\n"); 15 | double result = compute(data, n); 16 | printf("Result: %f\n", result); 17 | 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_comparison/Makefile: -------------------------------------------------------------------------------- 1 | 2 | OP = -O2 3 | CXX = FPC_INSTRUMENT=1 clang++-fpchecker 4 | 5 | all: 6 | $(CXX) -c main.cpp $(OP) 7 | $(CXX) -c compute.cpp $(OP) 8 | $(CXX) -o main compute.o main.o 9 | 10 | clean: 11 | rm -rf *.o main __pycache__ .fpc_logs .fpc_log.txt 12 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_comparison/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/cpu_checking/dynamic/test_fp64_comparison/__init__.py -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_comparison/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | double compute(double *x, int n); 4 | 5 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_comparison/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include "compute.h" 5 | 6 | int main(int argc, char **argv) 7 | { 8 | int n = 8; 9 | int nbytes = n*sizeof(double); 10 | double *data = (double *)malloc(nbytes); 11 | for (int i=0; i < n; ++i) 12 | data[i] = (double)(i+1); 13 | printf("Calling kernel\n"); 14 | double result = compute(data, n); 15 | printf("Result: %f\n", result); 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_division_zero/Makefile: -------------------------------------------------------------------------------- 1 | 2 | OP = -O2 3 | CXX = FPC_INSTRUMENT=1 clang++-fpchecker 4 | 5 | all: 6 | $(CXX) -c main.cpp $(OP) 7 | $(CXX) -c compute.cpp $(OP) 8 | $(CXX) -o main compute.o main.o 9 | 10 | clean: 11 | rm -rf *.o main __pycache__ .fpc_logs .fpc_log.txt 12 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_division_zero/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/cpu_checking/dynamic/test_fp64_division_zero/__init__.py -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_division_zero/compute.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | double compute(double *x, int n) { 5 | double res = 0.0; 6 | for (int i=0; i < n; ++i) { 7 | res = res + x[i]; 8 | 9 | // Division by zero 10 | res = res / (res-res); 11 | } 12 | return res; 13 | } 14 | 15 | 16 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_division_zero/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | double compute(double *x, int n); 4 | 5 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_division_zero/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include "compute.h" 5 | 6 | int main(int argc, char **argv) 7 | { 8 | int n = 8; 9 | int nbytes = n*sizeof(double); 10 | double *data = (double *)malloc(nbytes); 11 | for (int i=0; i < n; ++i) 12 | data[i] = (double)(i+1); 13 | printf("Calling kernel\n"); 14 | double result = compute(data, n); 15 | printf("Result: %f\n", result); 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_histogram_for_events/Makefile: -------------------------------------------------------------------------------- 1 | 2 | OP = -O2 -DFPC_EXPONENT_USAGE 3 | CXX = FPC_INSTRUMENT=1 clang++-fpchecker 4 | 5 | all: 6 | $(CXX) -c main.cpp $(OP) 7 | $(CXX) -c compute.cpp $(OP) 8 | $(CXX) -o main compute.o main.o 9 | 10 | clean: 11 | rm -rf *.o main __pycache__ .fpc_logs .fpc_log.txt 12 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_histogram_for_events/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/cpu_checking/dynamic/test_fp64_histogram_for_events/__init__.py -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_histogram_traces/Makefile: -------------------------------------------------------------------------------- 1 | 2 | OP = -O2 -DFPC_EXPONENT_USAGE 3 | CXX = FPC_INSTRUMENT=1 clang++-fpchecker 4 | 5 | all: 6 | $(CXX) -c main.cpp $(OP) 7 | $(CXX) -c compute.cpp $(OP) 8 | $(CXX) -o main compute.o main.o 9 | 10 | clean: 11 | rm -rf *.o main __pycache__ .fpc_logs .fpc_log.txt 12 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_histogram_traces/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/cpu_checking/dynamic/test_fp64_histogram_traces/__init__.py -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_histogram_traces/compute.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | double compute(double x, double y) { 5 | double res = x + y; 6 | return res; 7 | } 8 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_histogram_traces/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | double compute(double x, double y); 4 | 5 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_infinity_neg/Makefile: -------------------------------------------------------------------------------- 1 | 2 | OP = -O2 3 | CXX = FPC_INSTRUMENT=1 clang++-fpchecker #-DFPC_POSITIVE_OVERFLOW=1 4 | 5 | all: 6 | $(CXX) -c main.cpp $(OP) 7 | $(CXX) -c compute.cpp $(OP) 8 | $(CXX) -o main compute.o main.o 9 | 10 | clean: 11 | rm -rf *.o main __pycache__ .fpc_logs .fpc_log.txt 12 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_infinity_neg/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/cpu_checking/dynamic/test_fp64_infinity_neg/__init__.py -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_infinity_neg/compute.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | double compute(double *x, int n) { 5 | double res = 0.0; 6 | for (int i=0; i < n; ++i) { 7 | #ifdef FPC_POSITIVE_OVERFLOW 8 | res = res + x[i]; 9 | #else 10 | res = res - x[i]; 11 | #endif 12 | 13 | // Overflow 14 | res = res * (1e307 * 1e10); 15 | } 16 | return res; 17 | } 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_infinity_neg/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | double compute(double *x, int n); 4 | 5 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_infinity_neg/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include "compute.h" 5 | 6 | int main(int argc, char **argv) 7 | { 8 | int n = 8; 9 | int nbytes = n*sizeof(double); 10 | double *data = (double *)malloc(nbytes); 11 | for (int i=0; i < n; ++i) 12 | data[i] = (double)(i+1); 13 | printf("Calling kernel\n"); 14 | double result = compute(data, n); 15 | printf("Result: %f\n", result); 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_infinity_pos/Makefile: -------------------------------------------------------------------------------- 1 | 2 | OP = -O2 3 | CXX = FPC_INSTRUMENT=1 clang++-fpchecker -DFPC_POSITIVE_OVERFLOW=1 4 | 5 | all: 6 | $(CXX) -c main.cpp $(OP) 7 | $(CXX) -c compute.cpp $(OP) 8 | $(CXX) -o main compute.o main.o 9 | 10 | clean: 11 | rm -rf *.o main __pycache__ .fpc_logs .fpc_log.txt 12 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_infinity_pos/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/cpu_checking/dynamic/test_fp64_infinity_pos/__init__.py -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_infinity_pos/compute.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | double compute(double *x, int n) { 5 | double res = 0.0; 6 | for (int i=0; i < n; ++i) { 7 | #ifdef FPC_POSITIVE_OVERFLOW 8 | res = res + x[i]; 9 | #else 10 | res = res - x[i]; 11 | #endif 12 | 13 | // Overflow 14 | res = res * (1e307 * 1e10); 15 | } 16 | return res; 17 | } 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_infinity_pos/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | double compute(double *x, int n); 4 | 5 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_infinity_pos/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include "compute.h" 5 | 6 | int main(int argc, char **argv) 7 | { 8 | int n = 8; 9 | int nbytes = n*sizeof(double); 10 | double *data = (double *)malloc(nbytes); 11 | for (int i=0; i < n; ++i) 12 | data[i] = (double)(i+1); 13 | printf("Calling kernel\n"); 14 | double result = compute(data, n); 15 | printf("Result: %f\n", result); 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_latent_infinity_neg/Makefile: -------------------------------------------------------------------------------- 1 | 2 | OP = -O2 3 | CXX = FPC_INSTRUMENT=1 clang++-fpchecker 4 | 5 | all: 6 | $(CXX) -c main.cpp $(OP) 7 | $(CXX) -c compute.cpp $(OP) 8 | $(CXX) -o main compute.o main.o 9 | 10 | clean: 11 | rm -rf *.o main __pycache__ .fpc_logs 12 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_latent_infinity_neg/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/cpu_checking/dynamic/test_fp64_latent_infinity_neg/__init__.py -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_latent_infinity_neg/compute.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | double compute(double *x, int n) { 5 | double res = 0.0; 6 | for (int i=0; i < n; ++i) { 7 | //res = res + x[i]; 8 | 9 | // Latent overflow 10 | res = x[i] * -1e+300; 11 | } 12 | return res; 13 | } 14 | 15 | 16 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_latent_infinity_neg/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | double compute(double *x, int n); 4 | 5 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_latent_infinity_neg/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include "compute.h" 5 | 6 | int main(int argc, char **argv) 7 | { 8 | int n = 8; 9 | int nbytes = n*sizeof(double); 10 | double *data = (double *)malloc(nbytes); 11 | for (int i=0; i < n; ++i) 12 | data[i] = (double)(i+1); 13 | printf("Calling kernel\n"); 14 | double result = compute(data, n); 15 | printf("Result: %f\n", result); 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_latent_infinity_pos/Makefile: -------------------------------------------------------------------------------- 1 | 2 | OP = -O2 3 | CXX = FPC_INSTRUMENT=1 clang++-fpchecker 4 | 5 | all: 6 | $(CXX) -c main.cpp $(OP) 7 | $(CXX) -c compute.cpp $(OP) 8 | $(CXX) -o main compute.o main.o 9 | 10 | clean: 11 | rm -rf *.o main __pycache__ .fpc_logs 12 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_latent_infinity_pos/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/cpu_checking/dynamic/test_fp64_latent_infinity_pos/__init__.py -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_latent_infinity_pos/compute.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | double compute(double *x, int n) { 5 | double res = 0.0; 6 | for (int i=0; i < n; ++i) { 7 | //res = res + x[i]; 8 | 9 | // Latent overflow 10 | res = x[i] * 1e+300; 11 | } 12 | return res; 13 | } 14 | 15 | 16 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_latent_infinity_pos/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | double compute(double *x, int n); 4 | 5 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_latent_infinity_pos/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include "compute.h" 5 | 6 | int main(int argc, char **argv) 7 | { 8 | int n = 8; 9 | int nbytes = n*sizeof(double); 10 | double *data = (double *)malloc(nbytes); 11 | for (int i=0; i < n; ++i) 12 | data[i] = (double)(i+1); 13 | printf("Calling kernel\n"); 14 | double result = compute(data, n); 15 | printf("Result: %f\n", result); 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_latent_subnormal/Makefile: -------------------------------------------------------------------------------- 1 | 2 | OP = -O2 3 | CXX = FPC_INSTRUMENT=1 clang++-fpchecker 4 | 5 | all: 6 | $(CXX) -c main.cpp $(OP) 7 | $(CXX) -c compute.cpp $(OP) 8 | $(CXX) -o main compute.o main.o 9 | 10 | clean: 11 | rm -rf *.o main __pycache__ .fpc_logs 12 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_latent_subnormal/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/cpu_checking/dynamic/test_fp64_latent_subnormal/__init__.py -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_latent_subnormal/compute.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | double compute(double *x, int n) { 5 | double res = 0.0; 6 | for (int i=0; i < n; ++i) { 7 | //res = res + x[i]; 8 | 9 | // NaN 10 | res = x[i] * (1e-300); 11 | } 12 | return res; 13 | } 14 | 15 | 16 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_latent_subnormal/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | double compute(double *x, int n); 4 | 5 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_latent_subnormal/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include "compute.h" 5 | 6 | int main(int argc, char **argv) 7 | { 8 | int n = 8; 9 | int nbytes = n*sizeof(double); 10 | double *data = (double *)malloc(nbytes); 11 | for (int i=0; i < n; ++i) 12 | data[i] = (double)(i+1); 13 | printf("Calling kernel\n"); 14 | double result = compute(data, n); 15 | printf("Result: %f\n", result); 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_nan/Makefile: -------------------------------------------------------------------------------- 1 | 2 | OP = -O2 3 | #OP = -O2 -Wall -Wshadow -Wconversion -W -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wredundant-decls 4 | CXX = FPC_INSTRUMENT=1 clang++-fpchecker 5 | 6 | all: 7 | $(CXX) -c main.cpp $(OP) 8 | $(CXX) -c compute.cpp $(OP) 9 | $(CXX) -o main compute.o main.o 10 | 11 | clean: 12 | rm -rf *.o main __pycache__ .fpc_logs .fpc_log.txt 13 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_nan/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/cpu_checking/dynamic/test_fp64_nan/__init__.py -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_nan/compute.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | double compute(double *x, int n) { 5 | double res = 0.0; 6 | for (int i=0; i < n; ++i) { 7 | res = res + x[i]; 8 | 9 | // NaN 10 | res = (res-res) / (res-res); 11 | } 12 | return res; 13 | } 14 | 15 | 16 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_nan/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | double compute(double *x, int n); 4 | 5 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_nan/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include "compute.h" 5 | 6 | int main(int argc, char **argv) 7 | { 8 | int n = 8; 9 | int nbytes = n*sizeof(double); 10 | double *data = (double *)malloc(nbytes); 11 | for (int i=0; i < n; ++i) 12 | data[i] = (double)(i+1); 13 | printf("Calling kernel\n"); 14 | double result = compute(data, n); 15 | printf("Result: %f\n", result); 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_subnormal/Makefile: -------------------------------------------------------------------------------- 1 | 2 | OP = -O2 3 | CXX = FPC_INSTRUMENT=1 clang++-fpchecker 4 | 5 | all: 6 | $(CXX) -c main.cpp $(OP) 7 | $(CXX) -c compute.cpp $(OP) 8 | $(CXX) -o main compute.o main.o 9 | 10 | clean: 11 | rm -rf *.o main __pycache__ .fpc_logs 12 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_subnormal/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/cpu_checking/dynamic/test_fp64_subnormal/__init__.py -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_subnormal/compute.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | double compute(double *x, int n) { 5 | double res = 0.0; 6 | for (int i=0; i < n; ++i) { 7 | res = res + x[i]; 8 | 9 | // NaN 10 | res = res * (1e-300 * 1e-22); 11 | } 12 | return res; 13 | } 14 | 15 | 16 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_subnormal/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | double compute(double *x, int n); 4 | 5 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_subnormal/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include "compute.h" 5 | 6 | int main(int argc, char **argv) 7 | { 8 | int n = 8; 9 | int nbytes = n*sizeof(double); 10 | double *data = (double *)malloc(nbytes); 11 | for (int i=0; i < n; ++i) 12 | data[i] = (double)(i+1); 13 | printf("Calling kernel\n"); 14 | double result = compute(data, n); 15 | printf("Result: %f\n", result); 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_histogram_plotting/Makefile: -------------------------------------------------------------------------------- 1 | 2 | OP = -O2 -DFPC_EXPONENT_USAGE 3 | CXX = FPC_INSTRUMENT=1 clang++-fpchecker 4 | 5 | all: 6 | $(CXX) -c main.cpp $(OP) 7 | $(CXX) -c compute.cpp $(OP) 8 | $(CXX) -o main compute.o main.o 9 | 10 | clean: 11 | rm -rf *.o main __pycache__ .fpc_logs .fpc_log.txt plots 12 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_histogram_plotting/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/cpu_checking/dynamic/test_histogram_plotting/__init__.py -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_histogram_plotting/compute.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | double compute(double *x, int n) { 5 | double res = 0.0; 6 | for (int i=0; i < n; ++i) { 7 | res = res + x[i]; 8 | 9 | // NaN 10 | res = (res-res) / (res-res); 11 | } 12 | return res; 13 | } 14 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_histogram_plotting/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | double compute(double *x, int n); 4 | 5 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_histogram_plotting/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include "compute.h" 5 | 6 | int main(int argc, char **argv) 7 | { 8 | int n = 8; 9 | int nbytes = n*sizeof(double); 10 | double *data = (double *)malloc(nbytes); 11 | for (int i=0; i < n; ++i) 12 | data[i] = (double)(i+1); 13 | printf("Calling kernel\n"); 14 | double result = compute(data, n); 15 | printf("Result: %f\n", result); 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_long_filename/Makefile: -------------------------------------------------------------------------------- 1 | 2 | OP = -O2 3 | CXX = FPC_INSTRUMENT=1 clang++-fpchecker 4 | 5 | all: 6 | $(CXX) -c main.cpp $(OP) 7 | $(CXX) -c compute_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long.cpp $(OP) -o compute.o 8 | $(CXX) -o main compute.o main.o 9 | 10 | clean: 11 | rm -rf *.o main __pycache__ .fpc_logs .fpc_log.txt 12 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_long_filename/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/cpu_checking/dynamic/test_long_filename/__init__.py -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_long_filename/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | double compute(double *x, int n); 4 | 5 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_long_filename/compute_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | double compute(double *x, int n) { 5 | double res = 0.0; 6 | for (int i=0; i < n; ++i) { 7 | res = res + x[i]; 8 | 9 | // NaN 10 | res = (res-res) / (res-res); 11 | } 12 | return res; 13 | } 14 | 15 | 16 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_long_filename/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include "compute.h" 5 | 6 | int main(int argc, char **argv) 7 | { 8 | int n = 8; 9 | int nbytes = n*sizeof(double); 10 | double *data = (double *)malloc(nbytes); 11 | for (int i=0; i < n; ++i) 12 | data[i] = (double)(i+1); 13 | printf("Calling kernel\n"); 14 | double result = compute(data, n); 15 | printf("Result: %f\n", result); 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_long_paths/Makefile: -------------------------------------------------------------------------------- 1 | 2 | OP = -O2 3 | CXX = FPC_INSTRUMENT=1 clang++-fpchecker 4 | 5 | FILE=long_path/long_path/long_path/long_path/long_path/long_path/long_path/long_path/long_path/long_path/long_path/long_path/compute.cpp 6 | 7 | all: 8 | $(CXX) -c main.cpp $(OP) 9 | $(CXX) -c $(FILE) $(OP) 10 | $(CXX) -o main compute.o main.o 11 | 12 | clean: 13 | rm -rf *.o main __pycache__ .fpc_logs .fpc_log.txt 14 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_long_paths/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/cpu_checking/dynamic/test_long_paths/__init__.py -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_long_paths/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | double compute(double *x, int n); 4 | 5 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_long_paths/long_path/long_path/long_path/long_path/long_path/long_path/long_path/long_path/long_path/long_path/long_path/long_path/compute.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | double compute(double *x, int n) { 5 | double res = 0.0; 6 | for (int i=0; i < n; ++i) { 7 | res = res + x[i]; 8 | 9 | // NaN 10 | res = (res-res) / (res-res); 11 | } 12 | return res; 13 | } 14 | 15 | 16 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_long_paths/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include "compute.h" 5 | 6 | int main(int argc, char **argv) 7 | { 8 | int n = 8; 9 | int nbytes = n*sizeof(double); 10 | double *data = (double *)malloc(nbytes); 11 | for (int i=0; i < n; ++i) 12 | data[i] = (double)(i+1); 13 | printf("Calling kernel\n"); 14 | double result = compute(data, n); 15 | printf("Result: %f\n", result); 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_main_instrumentation/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/cpu_checking/dynamic/test_main_instrumentation/__init__.py -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_main_instrumentation/main_1.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | int main(int argc, char **argv) { 5 | double x=0; 6 | x = x + 1.2 * (double)(argc); 7 | x = x / (x-x); 8 | printf("x=%f\n", x); 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_main_instrumentation/main_2.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | 5 | int main() { 6 | double x=0; 7 | x = x + 1.2 * (double)(rand()); 8 | x = x / (x-x); 9 | printf("x=%f\n", x); 10 | return 0; 11 | } 12 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_main_instrumentation/main_3.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | int main(int argc, char *argv[]) { 5 | double x=0; 6 | x = x + 1.2 * (double)(argc); 7 | x = x / (x-x); 8 | printf("x=%f\n", x); 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_main_instrumentation/main_4.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | int main(int argc, char **argv) { 5 | double x=0; 6 | x = x + 1.2 * (double)(argc); 7 | x = x / (x-x); 8 | printf("x=%f\n", x); 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_main_instrumentation/main_5.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | 5 | int main() { 6 | double x=0; 7 | x = x + 1.2 * (double)(rand()); 8 | x = x / (x-x); 9 | printf("x=%f\n", x); 10 | return 0; 11 | } 12 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_main_instrumentation/main_6.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | int main(int argc, char *argv[]) { 5 | double x=0; 6 | x = x + 1.2 * (double)(argc); 7 | x = x / (x-x); 8 | printf("x=%f\n", x); 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_main_instrumentation/main_7.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | int main(int argc, char **argv, char **envp) { 5 | double x=0; 6 | x = x + 1.2 * (double)(argc); 7 | x = x / (x-x); 8 | printf("x=%f\n", x); 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_mpi_interceptor/Makefile: -------------------------------------------------------------------------------- 1 | 2 | OP = -O2 3 | #CXX = FPC_INSTRUMENT=1 mpicxx-fpchecker 4 | CXX = mpicxx 5 | 6 | all: 7 | $(CXX) -c main.cpp $(OP) 8 | $(CXX) -c compute.cpp $(OP) 9 | $(CXX) -o main compute.o main.o 10 | 11 | clean: 12 | rm -rf *.o main __pycache__ .fpc_logs .fpc_log.txt 13 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_mpi_interceptor/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/cpu_checking/dynamic/test_mpi_interceptor/__init__.py -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_mpi_interceptor/compute.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | double compute(double *x, int n) { 5 | double res = 0.0; 6 | for (int i=0; i < n; ++i) { 7 | res = res + x[i]; 8 | 9 | // NaN 10 | res = (res-res) / (res-res); 11 | } 12 | return res; 13 | } 14 | 15 | 16 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_mpi_interceptor/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | double compute(double *x, int n); 4 | 5 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_mpi_run/Makefile: -------------------------------------------------------------------------------- 1 | 2 | OP = -O2 3 | CXX = FPC_INSTRUMENT=1 mpicxx-fpchecker 4 | 5 | all: 6 | $(CXX) -c main.cpp $(OP) 7 | $(CXX) -c compute.cpp $(OP) 8 | $(CXX) -o main compute.o main.o 9 | 10 | clean: 11 | rm -rf *.o main __pycache__ .fpc_logs .fpc_log.txt 12 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_mpi_run/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/cpu_checking/dynamic/test_mpi_run/__init__.py -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_mpi_run/compute.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | double compute(double *x, int n) { 5 | double res = 0.0; 6 | for (int i=0; i < n; ++i) { 7 | res = res + x[i]; 8 | 9 | // NaN 10 | res = (res-res) / (res-res); 11 | } 12 | return res; 13 | } 14 | 15 | 16 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_mpi_run/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | double compute(double *x, int n); 4 | 5 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_mpi_with_strings/Makefile: -------------------------------------------------------------------------------- 1 | 2 | OP = -O2 -DCOMPILE_STRING=\"fpchecker\" 3 | CXX = mpicxx 4 | 5 | all: 6 | $(CXX) -c main.cpp $(OP) 7 | $(CXX) -c compute.cpp $(OP) 8 | $(CXX) -o main compute.o main.o 9 | 10 | clean: 11 | rm -rf *.o main __pycache__ .fpc_logs .fpc_log.txt 12 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_mpi_with_strings/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/cpu_checking/dynamic/test_mpi_with_strings/__init__.py -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_mpi_with_strings/compute.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | double compute(double *x, int n) { 5 | double res = 0.0; 6 | for (int i=0; i < n; ++i) { 7 | res = res + x[i]; 8 | 9 | // NaN 10 | res = (res-res) / (res-res); 11 | } 12 | std::string s(COMPILE_STRING); 13 | printf("string: %s\n", s.c_str()); 14 | return res; 15 | } 16 | 17 | 18 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_mpi_with_strings/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | double compute(double *x, int n); 4 | 5 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_multi_files/Makefile: -------------------------------------------------------------------------------- 1 | 2 | OP = -O0 3 | CXX = FPC_INSTRUMENT=1 clang++-fpchecker 4 | 5 | all: 6 | $(CXX) -c main.cpp $(OP) 7 | $(CXX) -o main main.o 8 | 9 | clean: 10 | rm -rf *.o main __pycache__ .fpc_logs 11 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_multi_files/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/cpu_checking/dynamic/test_multi_files/__init__.py -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_multi_files/header.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef HEADER_H_ 3 | #define HEADER_H_ 4 | 5 | #include 6 | 7 | void compute(double x, double y) { 8 | double tmp; 9 | tmp = x * y; 10 | tmp += 3.0; 11 | } 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_multi_files/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include "header.h" 4 | 5 | int main(int agc, char **argv) { 6 | double x = 1000.0; 7 | double y = 1e+308; 8 | compute(x, y); 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_openmp/Makefile: -------------------------------------------------------------------------------- 1 | 2 | CLANG_PATH = $(shell which clang) 3 | OMP_LIB = $(shell dirname $(CLANG_PATH))/../lib 4 | 5 | OP = -O2 -fopenmp 6 | CXX=FPC_VERBOSE=1 FPC_INSTRUMENT=1 clang++-fpchecker 7 | 8 | all: 9 | $(CXX) -c main.cpp $(OP) 10 | $(CXX) -c compute.cpp $(OP) 11 | $(CXX) -L$(OMP_LIB) -o main compute.o main.o -lomp 12 | 13 | clean: 14 | rm -rf *.o main __pycache__ .fpc_logs .fpc_log.txt 15 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_openmp/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/cpu_checking/dynamic/test_openmp/__init__.py -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_openmp/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | double compute(double *x, int n); 4 | 5 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_openmp/get_omp_lib_path.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | CLANG_PATH=`which clang` 4 | OMP_LIB_PATH=`dirname $CLANG_PATH` 5 | echo $OMP_LIB_PATH/../lib 6 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_openmp/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include "compute.h" 5 | 6 | int main(int argc, char **argv) 7 | { 8 | int n = 8; 9 | int nbytes = n*sizeof(double); 10 | double *data = (double *)malloc(nbytes); 11 | for (int i=0; i < n; ++i) 12 | data[i] = (double)(i+1); 13 | printf("Calling kernel\n"); 14 | double result = compute(data, n); 15 | printf("Result: %f\n", result); 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_str_comparisons/Makefile: -------------------------------------------------------------------------------- 1 | 2 | OP = -O2 3 | CXX = FPC_INSTRUMENT=1 clang++-fpchecker 4 | 5 | all: 6 | $(CXX) -c main.cpp $(OP) 7 | $(CXX) -o main main.o 8 | 9 | clean: 10 | rm -rf *.o main __pycache__ .fpc_logs .fpc_log.txt 11 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_str_comparisons/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/cpu_checking/dynamic/test_str_comparisons/__init__.py -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_string_compile_param/Makefile: -------------------------------------------------------------------------------- 1 | 2 | #OP = -O2 -DCOMPILE_STRING=\\\"fpchecker\\\" 3 | OP = -O2 -DCOMPILE_STRING=\"fpchecker\" 4 | CXX = FPC_INSTRUMENT=1 clang++-fpchecker 5 | 6 | all: 7 | $(CXX) -c main.cpp $(OP) 8 | $(CXX) -c compute.cpp $(OP) 9 | $(CXX) -o main compute.o main.o 10 | 11 | clean: 12 | rm -rf *.o main __pycache__ .fpc_logs .fpc_log.txt 13 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_string_compile_param/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/cpu_checking/dynamic/test_string_compile_param/__init__.py -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_string_compile_param/compute.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | 5 | double compute(double *x, int n) { 6 | double res = 0.0; 7 | std::string s(COMPILE_STRING); 8 | for (int i=0; i < n; ++i) { 9 | res = res + x[i]; 10 | 11 | // NaN 12 | res = (res-res) / (res-res); 13 | } 14 | printf("string: %s\n", s.c_str()); 15 | return res; 16 | } 17 | 18 | 19 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_string_compile_param/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | double compute(double *x, int n); 4 | 5 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_string_compile_param/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include "compute.h" 5 | 6 | int main(int argc, char **argv) 7 | { 8 | int n = 8; 9 | int nbytes = n*sizeof(double); 10 | double *data = (double *)malloc(nbytes); 11 | for (int i=0; i < n; ++i) 12 | data[i] = (double)(i+1); 13 | printf("Calling kernel\n"); 14 | double result = compute(data, n); 15 | printf("Result: %f\n", result); 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_traps_with_env_variables/Makefile: -------------------------------------------------------------------------------- 1 | 2 | OP = -O2 3 | CXX = FPC_INSTRUMENT=1 clang++-fpchecker 4 | 5 | all: 6 | $(CXX) -c main.cpp $(OP) 7 | $(CXX) -c compute.cpp $(OP) 8 | $(CXX) -o main compute.o main.o 9 | 10 | clean: 11 | rm -rf *.o main __pycache__ .fpc_logs .fpc_log.txt 12 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_traps_with_env_variables/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/cpu_checking/dynamic/test_traps_with_env_variables/__init__.py -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_traps_with_env_variables/compute.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | double compute(double *x, int n) { 5 | double res_1 = 0.0; 6 | double res_2 = 0.0; 7 | for (int i=0; i < n; ++i) { 8 | res_1 += x[i]; 9 | res_2 += x[i]; 10 | 11 | // Overflow 12 | res_2 = res_2 * (1e307 * 1e10); 13 | 14 | // NaN 15 | res_1 = (res_1-res_1) / (res_1-res_1); 16 | } 17 | return (res_1 - res_2); 18 | } 19 | 20 | 21 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_traps_with_env_variables/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | double compute(double *x, int n); 4 | 5 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_traps_with_env_variables/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include "compute.h" 5 | 6 | int main(int argc, char **argv) 7 | { 8 | int n = 8; 9 | int nbytes = n*sizeof(double); 10 | double *data = (double *)malloc(nbytes); 11 | for (int i=0; i < n; ++i) 12 | data[i] = (double)(i+1); 13 | printf("Calling kernel\n"); 14 | double result = compute(data, n); 15 | printf("Result: %f\n", result); 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /tests/cpu_checking/static/test_build_mpi/Makefile: -------------------------------------------------------------------------------- 1 | 2 | OP = -O2 3 | #CXX = FPC_INSTRUMENT=1 clang++-fpchecker 4 | CXX = mpicxx 5 | 6 | all: 7 | $(CXX) -c main.cpp $(OP) 8 | $(CXX) -c compute.cpp $(OP) 9 | $(CXX) -o main compute.o main.o 10 | 11 | clean: 12 | rm -rf *.o main __pycache__ .fpc_logs .fpc_log.txt 13 | -------------------------------------------------------------------------------- /tests/cpu_checking/static/test_build_mpi/compute.cpp: -------------------------------------------------------------------------------- 1 | 2 | 3 | #include "compute.h" 4 | #include 5 | #include 6 | 7 | void compute(double x) { 8 | 9 | double recbf; 10 | MPI_Reduce(&x, &recbf, 1, MPI_DOUBLE, MPI_SUM, 0, MPI_COMM_WORLD); 11 | int rank; 12 | MPI_Comm_rank(MPI_COMM_WORLD, &rank); 13 | if (rank == 0) 14 | printf("Sum: %f\n", recbf); 15 | } 16 | -------------------------------------------------------------------------------- /tests/cpu_checking/static/test_build_mpi/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | void compute(double x); 4 | -------------------------------------------------------------------------------- /tests/cpu_checking/static/test_build_mpi/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include "compute.h" 4 | 5 | int main(int argc, char **argv) { 6 | MPI_Init(&argc, &argv); 7 | double x=1.0; 8 | compute(x); 9 | MPI_Finalize(); 10 | return 0; 11 | } 12 | -------------------------------------------------------------------------------- /tests/cpu_checking/static/test_full_report_generation/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include "src/compute.h" 4 | 5 | int main(int argc, char **argv) { 6 | MPI_Init(&argc, &argv); 7 | double x=1.0; 8 | compute(x); 9 | MPI_Finalize(); 10 | return 0; 11 | } 12 | -------------------------------------------------------------------------------- /tests/cpu_checking/static/test_full_report_generation/src/compute.cpp: -------------------------------------------------------------------------------- 1 | 2 | 3 | #include "compute.h" 4 | #include 5 | #include 6 | 7 | void compute(double x) { 8 | 9 | double recbf; 10 | MPI_Reduce(&x, &recbf, 1, MPI_DOUBLE, MPI_SUM, 0, MPI_COMM_WORLD); 11 | int rank; 12 | MPI_Comm_rank(MPI_COMM_WORLD, &rank); 13 | if (rank == 0) 14 | printf("Sum: %f\n", recbf); 15 | 16 | for (int i; i < 10; ++i) { 17 | printf("%d\n", recbf); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /tests/cpu_checking/static/test_full_report_generation/src/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | void compute(double x); 4 | -------------------------------------------------------------------------------- /tests/cpu_checking/static/test_generate_report/test.cpp: -------------------------------------------------------------------------------- 1 | void compute() { 2 | double x = 0; 3 | double y = 0; 4 | double x = 0; 5 | } 6 | -------------------------------------------------------------------------------- /tests/cpu_checking/static/test_query_traces/.fpc_logs/fpc_lassen708_40200.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "file": "./test.cpp", 4 | "line": 1, 5 | "infinity_pos": 0, 6 | "infinity_neg": 1, 7 | "nan": 0, 8 | "division_zero": 0, 9 | "cancellation": 0, 10 | "comparison": 0, 11 | "underflow": 0, 12 | "latent_infinity_pos": 0, 13 | "latent_infinity_neg": 7, 14 | "latent_underflow": 0 15 | } 16 | ] 17 | -------------------------------------------------------------------------------- /tests/cpu_checking/static/test_query_traces/query_file.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "file": "test.cpp", 4 | "line": "any", 5 | "infinity_pos": 1, 6 | "infinity_neg": 0, 7 | "nan": 1, 8 | "division_zero": 0, 9 | "cancellation": 0, 10 | "comparison": 0, 11 | "underflow": 0, 12 | "latent_infinity_pos": 0, 13 | "latent_infinity_neg": 0, 14 | "latent_underflow": 0 15 | } 16 | ] 17 | -------------------------------------------------------------------------------- /tests/cpu_checking/static/test_query_traces/test.cpp: -------------------------------------------------------------------------------- 1 | void compute() { 2 | double x = 0; 3 | double y = 0; 4 | double x = 0; 5 | } 6 | -------------------------------------------------------------------------------- /tests/cpu_checking/static/test_recover_original_command/Makefile: -------------------------------------------------------------------------------- 1 | 2 | OP = -O0 3 | CXX = FPC_VERBOSE=1 FPC_INJECT_FAULT=1 FPC_INSTRUMENT=1 clang++-fpchecker 4 | 5 | all: 6 | $(CXX) -c main.cpp $(OP) 7 | $(CXX) -o main main.o 8 | 9 | clean: 10 | rm -rf *.o main __pycache__ .fpc_traces *.o.tmp .fpc_log.txt 11 | -------------------------------------------------------------------------------- /tests/cpu_checking/static/test_recover_original_command/header.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef HEADER_H_ 3 | #define HEADER_H_ 4 | 5 | #include 6 | 7 | void compute(double x, double y) { 8 | double tmp; 9 | tmp = x * y; 10 | tmp += 3.0; 11 | printf("result = %f\n", tmp); 12 | } 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /tests/cpu_checking/static/test_recover_original_command/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include "header.h" 4 | 5 | int main(int agc, char **argv) { 6 | double x = 1000.0; 7 | double y = 1e+308; 8 | compute(x, y); 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /tests/cpu_checking/static/test_show_text_report/test.cpp: -------------------------------------------------------------------------------- 1 | void compute() { 2 | double x = 0; 3 | double y = 0; 4 | double x = 0; 5 | } 6 | -------------------------------------------------------------------------------- /tests/cpu_checking/static/test_warnings/Makefile: -------------------------------------------------------------------------------- 1 | 2 | OP = -O2 -W -Wall -Werror 3 | #OP = -O2 -Wall -Wshadow -Wconversion -W -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wredundant-decls 4 | CXX = FPC_INSTRUMENT=1 clang++-fpchecker 5 | 6 | all: 7 | $(CXX) -c main.cpp $(OP) 8 | $(CXX) -c compute.cpp $(OP) 9 | $(CXX) -o main compute.o main.o 10 | 11 | clean: 12 | rm -rf *.o main __pycache__ .fpc_logs .fpc_log.txt 13 | -------------------------------------------------------------------------------- /tests/cpu_checking/static/test_warnings/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/cpu_checking/static/test_warnings/__init__.py -------------------------------------------------------------------------------- /tests/cpu_checking/static/test_warnings/compute.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | double compute(double *x, int n) { 5 | double res = 0.0; 6 | for (int i=0; i < n; ++i) { 7 | res = res + x[i]; 8 | 9 | // NaN 10 | res = (res-res) / (res-res); 11 | } 12 | return res; 13 | } 14 | 15 | 16 | -------------------------------------------------------------------------------- /tests/cpu_checking/static/test_warnings/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | double compute(double *x, int n); 4 | 5 | -------------------------------------------------------------------------------- /tests/cpu_checking/static/test_warnings/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include "compute.h" 5 | 6 | int main() 7 | { 8 | int n = 8; 9 | int nbytes = n*sizeof(double); 10 | double *data = (double *)malloc(nbytes); 11 | for (int i=0; i < n; ++i) 12 | data[i] = (double)(i+1); 13 | printf("Calling kernel\n"); 14 | double result = compute(data, n); 15 | printf("Result: %f\n", result); 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /tests/llvm/dynamic/_test_config.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | # Config of test framework 4 | 5 | textWidth = "{:60}" 6 | -------------------------------------------------------------------------------- /tests/llvm/dynamic/_test_config.py.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | # Config of test framework 4 | 5 | textWidth = "{:60}" 6 | path = "@CMAKE_BINARY_DIR@/tests/dynamic" 7 | -------------------------------------------------------------------------------- /tests/llvm/dynamic/test_debug_info_is_correct/Makefile: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP = $(LLVM_PASS) -O0 -x cuda --cuda-gpu-arch=sm_60 -g 4 | 5 | #LINK = -L${CUDA_PATH}/lib64/ -lcuda -lcudart 6 | LINK = -L$(shell ../get_cuda_lib_path.sh) -lcuda -lcudart 7 | 8 | all: 9 | $(CC) -c dot_product.cu $(OP) 10 | $(CC) -c main.cu $(OP) 11 | $(CC) -o main dot_product.o main.o $(LINK) 12 | 13 | clean: 14 | rm -rf *.o main __pycache__ 15 | -------------------------------------------------------------------------------- /tests/llvm/dynamic/test_debug_info_is_correct/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(double a, double b, double *res); 4 | 5 | __global__ void dot_prod(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tests/llvm/dynamic/test_errors_dont_abort/Makefile.0: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP = $(LLVM_PASS) -O0 -x cuda --cuda-gpu-arch=sm_60 -g -DFPC_ERRORS_DONT_ABORT 4 | LINK = -L$(shell ../get_cuda_lib_path.sh) -lcuda -lcudart 5 | 6 | all: 7 | $(CC) -c dot_product.cu $(OP) 8 | $(CC) -c main.cu $(OP) 9 | $(CC) -o main dot_product.o main.o $(LINK) 10 | 11 | clean: 12 | rm -rf *.o main __pycache__ 13 | -------------------------------------------------------------------------------- /tests/llvm/dynamic/test_errors_dont_abort/Makefile.1: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP = $(LLVM_PASS) -O1 -x cuda --cuda-gpu-arch=sm_60 -g -DFPC_ERRORS_DONT_ABORT 4 | LINK = -L$(shell ../get_cuda_lib_path.sh) -lcuda -lcudart 5 | 6 | all: 7 | $(CC) -c dot_product.cu $(OP) 8 | $(CC) -c main.cu $(OP) 9 | $(CC) -o main dot_product.o main.o $(LINK) 10 | 11 | clean: 12 | rm -rf *.o *.bc *.ll *.core main __pycache__ 13 | -------------------------------------------------------------------------------- /tests/llvm/dynamic/test_errors_dont_abort/Makefile.2: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP = $(LLVM_PASS) -O2 -x cuda --cuda-gpu-arch=sm_60 -g -DFPC_ERRORS_DONT_ABORT 4 | LINK = -L$(shell ../get_cuda_lib_path.sh) -lcuda -lcudart 5 | 6 | all: 7 | $(CC) -c dot_product.cu $(OP) 8 | $(CC) -c main.cu $(OP) 9 | $(CC) -o main dot_product.o main.o $(LINK) 10 | 11 | clean: 12 | rm *.o *.bc *.ll *.core main 13 | -------------------------------------------------------------------------------- /tests/llvm/dynamic/test_errors_dont_abort/Makefile.3: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP = $(LLVM_PASS) -O3 -x cuda --cuda-gpu-arch=sm_60 -g -DFPC_ERRORS_DONT_ABORT 4 | LINK = -L$(shell ../get_cuda_lib_path.sh) -lcuda -lcudart 5 | 6 | all: 7 | $(CC) -c dot_product.cu $(OP) 8 | $(CC) -c main.cu $(OP) 9 | $(CC) -o main dot_product.o main.o $(LINK) 10 | 11 | clean: 12 | rm *.o *.bc *.ll *.core main 13 | -------------------------------------------------------------------------------- /tests/llvm/dynamic/test_errors_dont_abort/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(double a, double b, double *res); 4 | 5 | __global__ void dot_prod(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tests/llvm/dynamic/test_fp32_almost_underflow_found/Makefile.1: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP = $(LLVM_PASS) -O0 -x cuda --cuda-gpu-arch=sm_60 -g -DFPC_DANGER_ZONE_PERCENT=0.08 4 | LINK = -L$(shell ../get_cuda_lib_path.sh) -lcuda -lcudart 5 | 6 | all: 7 | $(CC) -c dot_product.cu $(OP) 8 | $(CC) -c main.cu $(OP) 9 | $(CC) -o main dot_product.o main.o $(LINK) 10 | 11 | clean: 12 | rm -rf *.o main __pycache__ 13 | -------------------------------------------------------------------------------- /tests/llvm/dynamic/test_fp32_almost_underflow_found/Makefile.2: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP = $(LLVM_PASS) -O0 -x cuda --cuda-gpu-arch=sm_60 -g -DFPC_DANGER_ZONE_PERCENT=0.03 4 | LINK = -L$(shell ../get_cuda_lib_path.sh) -lcuda -lcudart 5 | 6 | all: 7 | $(CC) -c dot_product.cu $(OP) 8 | $(CC) -c main.cu $(OP) 9 | $(CC) -o main dot_product.o main.o $(LINK) 10 | 11 | clean: 12 | rm *.o main 13 | -------------------------------------------------------------------------------- /tests/llvm/dynamic/test_fp32_almost_underflow_found/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(float a, float b, float *res); 4 | 5 | __global__ void dot_prod(float *x, float *y, int size); 6 | -------------------------------------------------------------------------------- /tests/llvm/dynamic/test_fp32_nan_found/Makefile: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP = $(LLVM_PASS) -O0 -x cuda --cuda-gpu-arch=sm_60 -g 4 | LINK = -L$(shell ../get_cuda_lib_path.sh) -lcuda -lcudart 5 | 6 | all: 7 | $(CC) -c dot_product.cu $(OP) 8 | $(CC) -c main.cu $(OP) 9 | $(CC) -o main dot_product.o main.o $(LINK) 10 | 11 | clean: 12 | rm -rf *.o main __pycache__ 13 | -------------------------------------------------------------------------------- /tests/llvm/dynamic/test_fp32_nan_found/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(float a, float b, float *res); 4 | 5 | __global__ void dot_prod(float *x, float *y, int size); 6 | -------------------------------------------------------------------------------- /tests/llvm/dynamic/test_fp32_overflow_found/Makefile: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP = $(LLVM_PASS) -O0 -x cuda --cuda-gpu-arch=sm_60 -g 4 | LINK = -L$(shell ../get_cuda_lib_path.sh) -lcuda -lcudart 5 | 6 | all: 7 | $(CC) -c dot_product.cu $(OP) 8 | $(CC) -c main.cu $(OP) 9 | $(CC) -o main dot_product.o main.o $(LINK) 10 | 11 | clean: 12 | rm -rf *.o main __pycache__ 13 | -------------------------------------------------------------------------------- /tests/llvm/dynamic/test_fp32_overflow_found/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(float a, float b, float *res); 4 | 5 | __global__ void dot_prod(float *x, float *y, int size); 6 | -------------------------------------------------------------------------------- /tests/llvm/dynamic/test_fp32_underflow_found/Makefile: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP = $(LLVM_PASS) -O0 -x cuda --cuda-gpu-arch=sm_60 -g 4 | LINK = -L$(shell ../get_cuda_lib_path.sh) -lcuda -lcudart 5 | 6 | all: 7 | $(CC) -c dot_product.cu $(OP) 8 | $(CC) -c main.cu $(OP) 9 | $(CC) -o main dot_product.o main.o $(LINK) 10 | 11 | clean: 12 | rm -rf *.o main __pycache__ 13 | -------------------------------------------------------------------------------- /tests/llvm/dynamic/test_fp32_underflow_found/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(float a, float b, float *res); 4 | 5 | __global__ void dot_prod(float *x, float *y, int size); 6 | -------------------------------------------------------------------------------- /tests/llvm/dynamic/test_fp64_almost_underflow_found/Makefile.1: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP = $(LLVM_PASS) -O0 -x cuda --cuda-gpu-arch=sm_60 -g -DFPC_DANGER_ZONE_PERCENT=0.15 4 | LINK = -L$(shell ../get_cuda_lib_path.sh) -lcuda -lcudart 5 | 6 | all: 7 | $(CC) -c dot_product.cu $(OP) 8 | $(CC) -c main.cu $(OP) 9 | $(CC) -o main dot_product.o main.o $(LINK) 10 | 11 | clean: 12 | rm -rf *.o main __pycache__ 13 | -------------------------------------------------------------------------------- /tests/llvm/dynamic/test_fp64_almost_underflow_found/Makefile.2: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP = $(LLVM_PASS) -O0 -x cuda --cuda-gpu-arch=sm_60 -g -DFPC_DANGER_ZONE_PERCENT=0.05 4 | LINK = -L$(shell ../get_cuda_lib_path.sh) -lcuda -lcudart 5 | 6 | all: 7 | $(CC) -c dot_product.cu $(OP) 8 | $(CC) -c main.cu $(OP) 9 | $(CC) -o main dot_product.o main.o $(LINK) 10 | 11 | clean: 12 | rm *.o main 13 | -------------------------------------------------------------------------------- /tests/llvm/dynamic/test_fp64_almost_underflow_found/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(double a, double b, double *res); 4 | 5 | __global__ void dot_prod(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tests/llvm/dynamic/test_fp64_nan_found/Makefile: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP = $(LLVM_PASS) -O0 -x cuda --cuda-gpu-arch=sm_60 -g 4 | LINK = -L$(shell ../get_cuda_lib_path.sh) -lcuda -lcudart 5 | 6 | all: 7 | $(CC) -c dot_product.cu $(OP) 8 | $(CC) -c main.cu $(OP) 9 | $(CC) -o main dot_product.o main.o $(LINK) 10 | 11 | clean: 12 | rm -rf *.o main __pycache__ 13 | -------------------------------------------------------------------------------- /tests/llvm/dynamic/test_fp64_nan_found/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(double a, double b, double *res); 4 | 5 | __global__ void dot_prod(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tests/llvm/dynamic/test_fp64_overflow_found/Makefile.1: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP = $(LLVM_PASS) -O0 -x cuda --cuda-gpu-arch=sm_60 -g -DFPC_POSITIVE_OVERFLOW 4 | LINK = -L$(shell ../get_cuda_lib_path.sh) -lcuda -lcudart 5 | 6 | all: 7 | $(CC) -c dot_product.cu $(OP) 8 | $(CC) -c main.cu $(OP) 9 | $(CC) -o main dot_product.o main.o $(LINK) 10 | 11 | clean: 12 | rm -rf *.o main __pycache__ 13 | -------------------------------------------------------------------------------- /tests/llvm/dynamic/test_fp64_overflow_found/Makefile.2: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP = $(LLVM_PASS) -O0 -x cuda --cuda-gpu-arch=sm_60 -g 4 | LINK = -L$(shell ../get_cuda_lib_path.sh) -lcuda -lcudart 5 | 6 | all: 7 | $(CC) -c dot_product.cu $(OP) 8 | $(CC) -c main.cu $(OP) 9 | $(CC) -o main dot_product.o main.o $(LINK) 10 | 11 | clean: 12 | rm *.o main 13 | -------------------------------------------------------------------------------- /tests/llvm/dynamic/test_fp64_overflow_found/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(double a, double b, double *res); 4 | 5 | __global__ void dot_prod(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tests/llvm/dynamic/test_fp64_underflow_found/Makefile: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP = $(LLVM_PASS) -O0 -x cuda --cuda-gpu-arch=sm_60 -g 4 | LINK = -L$(shell ../get_cuda_lib_path.sh) -lcuda -lcudart 5 | 6 | all: 7 | $(CC) -c dot_product.cu $(OP) 8 | $(CC) -c main.cu $(OP) 9 | $(CC) -o main dot_product.o main.o $(LINK) 10 | 11 | clean: 12 | rm -rf *.o main __pycache__ 13 | -------------------------------------------------------------------------------- /tests/llvm/dynamic/test_fp64_underflow_found/compute.cu: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | __device__ 5 | double power(double x) 6 | { 7 | double y = (x-x)/(x-x); 8 | return x*x + 2.0 + y; 9 | } 10 | 11 | __global__ 12 | void compute(double x) 13 | { 14 | double y = power(x); 15 | y = y + x; 16 | int tid = blockIdx.x * blockDim.x + threadIdx.x; 17 | 18 | if (tid == 0) { 19 | printf("y: %f\n", y); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /tests/llvm/dynamic/test_fp64_underflow_found/compute.h: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | __device__ 5 | double power(double x); 6 | 7 | __global__ 8 | void compute(double x); 9 | -------------------------------------------------------------------------------- /tests/llvm/dynamic/test_fp64_underflow_found/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(double a, double b, double *res); 4 | 5 | __global__ void dot_prod(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tests/llvm/dynamic/test_ops_are_correct/Makefile.1: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP = $(LLVM_PASS) -O0 -x cuda --cuda-gpu-arch=sm_60 -g -DFPC_ERROR_ADD 4 | LINK = -L$(shell ../get_cuda_lib_path.sh) -lcuda -lcudart 5 | 6 | all: 7 | $(CC) -c dot_product.cu $(OP) 8 | $(CC) -c main.cu $(OP) 9 | $(CC) -o main dot_product.o main.o $(LINK) 10 | 11 | clean: 12 | rm -rf *.o main __pycache__ 13 | -------------------------------------------------------------------------------- /tests/llvm/dynamic/test_ops_are_correct/Makefile.2: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP = $(LLVM_PASS) -O0 -x cuda --cuda-gpu-arch=sm_60 -g -DFPC_ERROR_SUB 4 | LINK = -L$(shell ../get_cuda_lib_path.sh) -lcuda -lcudart 5 | 6 | all: 7 | $(CC) -c dot_product.cu $(OP) 8 | $(CC) -c main.cu $(OP) 9 | $(CC) -o main dot_product.o main.o $(LINK) 10 | 11 | clean: 12 | rm *.o main 13 | -------------------------------------------------------------------------------- /tests/llvm/dynamic/test_ops_are_correct/Makefile.3: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP = $(LLVM_PASS) -O0 -x cuda --cuda-gpu-arch=sm_60 -g -DFPC_ERROR_MUL 4 | LINK = -L$(shell ../get_cuda_lib_path.sh) -lcuda -lcudart 5 | 6 | all: 7 | $(CC) -c dot_product.cu $(OP) 8 | $(CC) -c main.cu $(OP) 9 | $(CC) -o main dot_product.o main.o $(LINK) 10 | 11 | clean: 12 | rm *.o main 13 | -------------------------------------------------------------------------------- /tests/llvm/dynamic/test_ops_are_correct/Makefile.4: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP = $(LLVM_PASS) -O0 -x cuda --cuda-gpu-arch=sm_60 -g -DFPC_ERROR_DIV 4 | LINK = -L$(shell ../get_cuda_lib_path.sh) -lcuda -lcudart 5 | 6 | all: 7 | $(CC) -c dot_product.cu $(OP) 8 | $(CC) -c main.cu $(OP) 9 | $(CC) -o main dot_product.o main.o $(LINK) 10 | 11 | clean: 12 | rm *.o main 13 | -------------------------------------------------------------------------------- /tests/llvm/dynamic/test_ops_are_correct/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(double a, double b, double *res); 4 | 5 | __global__ void dot_prod(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tests/llvm/dynamic/test_performance_errors_dont_abort/arr_sum.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __global__ void array_sum(double *x, double *y); 4 | 5 | -------------------------------------------------------------------------------- /tests/llvm/dynamic/test_performance_errors_dont_abort/get_node_with_GPU.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | 3 | bsub -G guests -Is bash 4 | -------------------------------------------------------------------------------- /tests/llvm/dynamic/test_print_at_main/Makefile: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP = $(LLVM_PASS) -O0 -x cuda --cuda-gpu-arch=sm_60 -g 4 | LINK = -L$(shell ../get_cuda_lib_path.sh) -lcuda -lcudart 5 | 6 | all: 7 | $(CC) -c dot_product.cu $(OP) 8 | $(CC) -c main.cu $(OP) 9 | $(CC) -o main dot_product.o main.o $(LINK) 10 | 11 | clean: 12 | rm -rf *.o main __pycache__ 13 | -------------------------------------------------------------------------------- /tests/llvm/dynamic/test_print_at_main/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(double a, double b, double *res); 4 | 5 | __global__ void dot_prod(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tests/llvm/dynamic/test_raja_examples/Makefile.errors_abort: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP_LEVEL = -O0 4 | 5 | OP = $(LLVM_PASS) $(OP_LEVEL) -std=c++11 -x cuda --cuda-gpu-arch=sm_60 -g -I$(RAJA_PATH)/include 6 | LINK = -L$(shell ../get_cuda_lib_path.sh) -lcuda -lcudart \ 7 | -L$(RAJA_PATH)/lib -lRAJA 8 | all: 9 | $(CC) $(OP) -c dot_product_raja.cpp 10 | $(CC) -o main dot_product_raja.o $(LINK) 11 | 12 | clean: 13 | rm -rf *.o *.core main __pycache__ 14 | -------------------------------------------------------------------------------- /tests/llvm/dynamic/test_raja_examples/Makefile.errors_dont_abort: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP_LEVEL = -O0 4 | 5 | OP = $(LLVM_PASS) $(OP_LEVEL) -std=c++11 -x cuda --cuda-gpu-arch=sm_60 -g -I$(RAJA_PATH)/include -DFPC_ERRORS_DONT_ABORT 6 | LINK = -L$(shell ../get_cuda_lib_path.sh) -lcuda -lcudart \ 7 | -L$(RAJA_PATH)/lib -lRAJA 8 | all: 9 | $(CC) $(OP) -c dot_product_raja.cpp 10 | $(CC) -o main dot_product_raja.o $(LINK) 11 | 12 | clean: 13 | rm *.o *.core main 14 | -------------------------------------------------------------------------------- /tests/llvm/dynamic/test_warning_dont_abort/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(double a, double b, double *res); 4 | 5 | __global__ void dot_prod(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tests/llvm/dynamic/test_warnings_dont_abort/Makefile.0: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP = $(LLVM_PASS) -O0 -x cuda --cuda-gpu-arch=sm_60 -g -DFPC_ERRORS_DONT_ABORT -DFPC_DANGER_ZONE_PERCENT=0.80 4 | LINK = -L$(shell ../get_cuda_lib_path.sh) -lcuda -lcudart 5 | 6 | all: 7 | $(CC) -c dot_product.cu $(OP) 8 | $(CC) -c main.cu $(OP) 9 | $(CC) -o main dot_product.o main.o $(LINK) 10 | 11 | clean: 12 | rm -rf *.o main __pycache__ 13 | -------------------------------------------------------------------------------- /tests/llvm/dynamic/test_warnings_dont_abort/Makefile.1: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP = $(LLVM_PASS) -O1 -x cuda --cuda-gpu-arch=sm_60 -g -DFPC_ERRORS_DONT_ABORT -DFPC_DANGER_ZONE_PERCENT=0.80 4 | LINK = -L$(shell ../get_cuda_lib_path.sh) -lcuda -lcudart 5 | 6 | all: 7 | $(CC) -c dot_product.cu $(OP) 8 | $(CC) -c main.cu $(OP) 9 | $(CC) -o main dot_product.o main.o $(LINK) 10 | 11 | clean: 12 | rm *.o *.bc *.ll *.core main 13 | -------------------------------------------------------------------------------- /tests/llvm/dynamic/test_warnings_dont_abort/Makefile.2: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP = $(LLVM_PASS) -O2 -x cuda --cuda-gpu-arch=sm_60 -g -DFPC_ERRORS_DONT_ABORT -DFPC_DANGER_ZONE_PERCENT=0.80 4 | LINK = -L$(shell ../get_cuda_lib_path.sh) -lcuda -lcudart 5 | 6 | all: 7 | $(CC) -c dot_product.cu $(OP) 8 | $(CC) -c main.cu $(OP) 9 | $(CC) -o main dot_product.o main.o $(LINK) 10 | 11 | clean: 12 | rm *.o *.bc *.ll *.core main 13 | -------------------------------------------------------------------------------- /tests/llvm/dynamic/test_warnings_dont_abort/Makefile.3: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP = $(LLVM_PASS) -O3 -x cuda --cuda-gpu-arch=sm_60 -g -DFPC_ERRORS_DONT_ABORT -DFPC_DANGER_ZONE_PERCENT=0.80 4 | LINK = -L$(shell ../get_cuda_lib_path.sh) -lcuda -lcudart 5 | 6 | all: 7 | $(CC) -c dot_product.cu $(OP) 8 | $(CC) -c main.cu $(OP) 9 | $(CC) -o main dot_product.o main.o $(LINK) 10 | 11 | clean: 12 | rm *.o *.bc *.ll *.core main 13 | -------------------------------------------------------------------------------- /tests/llvm/dynamic/test_warnings_dont_abort/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(double a, double b, double *res); 4 | 5 | __global__ void dot_prod(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tests/llvm/static/_test_config.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | # Config of test framework 4 | 5 | textWidth = "{:60}" 6 | path = "." 7 | -------------------------------------------------------------------------------- /tests/llvm/static/_test_config.py.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | # Config of test framework 4 | 5 | textWidth = "{:60}" 6 | path = "@CMAKE_BINARY_DIR@/tests/static" 7 | -------------------------------------------------------------------------------- /tests/llvm/static/test_correct_inst_functions_found/Makefile.0: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP_LEVEL = -O0 4 | OP = $(LLVM_PASS) -x cuda --cuda-gpu-arch=sm_60 -g $(OP_LEVEL) 5 | 6 | #LINK = -L${CUDA_PATH}/lib64/ -lcuda -lcudart 7 | 8 | all: 9 | $(CC) -c compute.cu $(OP) 10 | 11 | clean: 12 | rm -rf *.o __pycache__ 13 | -------------------------------------------------------------------------------- /tests/llvm/static/test_correct_inst_functions_found/Makefile.1: -------------------------------------------------------------------------------- 1 | include ../../Makefile.config 2 | 3 | OP_LEVEL = -O1 4 | OP = $(LLVM_PASS) -x cuda --cuda-gpu-arch=sm_60 -g $(OP_LEVEL) 5 | 6 | LINK = -L${CUDA_PATH}/lib64/ -lcuda -lcudart 7 | 8 | all: 9 | $(CC) -c compute.cu $(OP) 10 | 11 | clean: 12 | rm *.o main 13 | -------------------------------------------------------------------------------- /tests/llvm/static/test_correct_inst_functions_found/Makefile.2: -------------------------------------------------------------------------------- 1 | include ../../Makefile.config 2 | 3 | OP_LEVEL = -O2 4 | OP = $(LLVM_PASS) -x cuda --cuda-gpu-arch=sm_60 -g $(OP_LEVEL) 5 | 6 | LINK = -L${CUDA_PATH}/lib64/ -lcuda -lcudart 7 | 8 | all: 9 | $(CC) -c compute.cu $(OP) 10 | 11 | clean: 12 | rm *.o main 13 | -------------------------------------------------------------------------------- /tests/llvm/static/test_correct_inst_functions_found/Makefile.3: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP_LEVEL = -O3 4 | OP = $(LLVM_PASS) -x cuda --cuda-gpu-arch=sm_60 -g $(OP_LEVEL) 5 | 6 | LINK = -L${CUDA_PATH}/lib64/ -lcuda -lcudart 7 | 8 | all: 9 | $(CC) -c compute.cu $(OP) 10 | 11 | clean: 12 | rm *.o main 13 | -------------------------------------------------------------------------------- /tests/llvm/static/test_correct_inst_functions_found/compute.cu: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | __device__ 5 | double power(double x) 6 | { 7 | double y = (x-x)/(x-x); 8 | return x*x + 2.0 + y; 9 | } 10 | 11 | __global__ 12 | void compute(double x) 13 | { 14 | double y = power(x); 15 | y = y + x; 16 | int tid = blockIdx.x * blockDim.x + threadIdx.x; 17 | 18 | if (tid == 0) { 19 | printf("y: %f\n", y); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /tests/llvm/static/test_device_func_found/Makefile: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP = $(LLVM_PASS) -O0 -x cuda --cuda-gpu-arch=sm_60 -g 4 | 5 | #LINK = -L${CUDA_PATH}/lib64/ -lcuda -lcudart 6 | 7 | all: 8 | $(CC) -c compute.cu $(OP) 9 | 10 | clean: 11 | rm -rf *.o __pycache__ 12 | -------------------------------------------------------------------------------- /tests/llvm/static/test_device_func_found/compute.cu: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | __device__ 5 | double power(double x) 6 | { 7 | double y = (x-x)/(x-x); 8 | return x*x + 2.0 + y; 9 | } 10 | 11 | __global__ 12 | void compute(double x) 13 | { 14 | double y = power(x); 15 | y = y + x; 16 | int tid = blockIdx.x * blockDim.x + threadIdx.x; 17 | 18 | if (tid == 0) { 19 | printf("y: %f\n", y); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /tests/llvm/static/test_find_inst_functions/Makefile: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP = $(LLVM_PASS) -O0 -x cuda --cuda-gpu-arch=sm_60 -g 4 | 5 | #LINK = -L${CUDA_PATH}/lib64/ -lcuda -lcudart 6 | 7 | all: 8 | $(CC) -c compute.cu $(OP) 9 | 10 | clean: 11 | rm -rf *.o __pycache__ 12 | -------------------------------------------------------------------------------- /tests/llvm/static/test_find_inst_functions/compute.cu: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | __device__ 5 | double power(double x) 6 | { 7 | double y = (x-x)/(x-x); 8 | return x*x + 2.0 + y; 9 | } 10 | 11 | __global__ 12 | void compute(double x) 13 | { 14 | double y = power(x); 15 | y = y + x; 16 | int tid = blockIdx.x * blockDim.x + threadIdx.x; 17 | 18 | if (tid == 0) { 19 | printf("y: %f\n", y); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /tests/llvm/static/test_global_array_instrumentation/Makefile.0: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP = $(LLVM_PASS) -O0 -x cuda --cuda-gpu-arch=sm_60 -g -DFPC_ERRORS_DONT_ABORT 4 | 5 | #LINK = -L${CUDA_PATH}/lib64/ -lcuda -lcudart 6 | 7 | all: 8 | $(CC) -c compute.cu $(OP) 9 | 10 | clean: 11 | rm -rf *.o __pycache__ 12 | -------------------------------------------------------------------------------- /tests/llvm/static/test_global_array_instrumentation/Makefile.1: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP = $(LLVM_PASS) -O1 -x cuda --cuda-gpu-arch=sm_60 -g -DFPC_ERRORS_DONT_ABORT 4 | 5 | #LINK = -L${CUDA_PATH}/lib64/ -lcuda -lcudart 6 | 7 | all: 8 | $(CC) -c compute.cu $(OP) 9 | 10 | clean: 11 | rm *.o *.ll *.bc main 12 | -------------------------------------------------------------------------------- /tests/llvm/static/test_global_array_instrumentation/Makefile.2: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP = $(LLVM_PASS) -O2 -x cuda --cuda-gpu-arch=sm_60 -g -DFPC_ERRORS_DONT_ABORT 4 | 5 | #LINK = -L${CUDA_PATH}/lib64/ -lcuda -lcudart 6 | 7 | all: 8 | $(CC) -c compute.cu $(OP) 9 | 10 | clean: 11 | rm *.o *.ll *.bc main 12 | -------------------------------------------------------------------------------- /tests/llvm/static/test_global_array_instrumentation/Makefile.3: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP = $(LLVM_PASS) -O3 -x cuda --cuda-gpu-arch=sm_60 -g -DFPC_ERRORS_DONT_ABORT 4 | 5 | #LINK = -L${CUDA_PATH}/lib64/ -lcuda -lcudart 6 | 7 | all: 8 | $(CC) -c compute.cu $(OP) 9 | 10 | clean: 11 | rm *.o *.ll *.bc main 12 | -------------------------------------------------------------------------------- /tests/llvm/static/test_global_array_instrumentation/compute.cu: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | __device__ 5 | double power(double x) 6 | { 7 | double y = (x-x)/(x-x); 8 | return x*x + 2.0 + y; 9 | } 10 | 11 | __global__ 12 | void compute(double x) 13 | { 14 | double y = power(x); 15 | y = y + x; 16 | int tid = blockIdx.x * blockDim.x + threadIdx.x; 17 | 18 | if (tid == 0) { 19 | printf("y: %f\n", y); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /tests/llvm/static/test_global_func_found/Makefile: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP = $(LLVM_PASS) -O0 -x cuda --cuda-gpu-arch=sm_60 -g 4 | 5 | #LINK = -L${CUDA_PATH}/lib64/ -lcuda -lcudart 6 | 7 | all: 8 | $(CC) -c compute.cu $(OP) 9 | 10 | clean: 11 | rm -rf *.o __pycache__ 12 | -------------------------------------------------------------------------------- /tests/llvm/static/test_global_func_found/compute.cu: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | __device__ 5 | double power(double x) 6 | { 7 | double y = (x-x)/(x-x); 8 | return x*x + 2.0 + y; 9 | } 10 | 11 | __global__ 12 | void compute(double x) 13 | { 14 | double y = power(x); 15 | y = y + x; 16 | int tid = blockIdx.x * blockDim.x + threadIdx.x; 17 | 18 | if (tid == 0) { 19 | printf("y: %f\n", y); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /tests/llvm/static/test_global_warnings_instrumentation/Makefile.0: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP = $(LLVM_PASS) -O0 -x cuda --cuda-gpu-arch=sm_60 -g -DFPC_ERRORS_DONT_ABORT 4 | 5 | #LINK = -L${CUDA_PATH}/lib64/ -lcuda -lcudart 6 | 7 | all: 8 | $(CC) -c compute.cu $(OP) 9 | 10 | clean: 11 | rm *.o *.ll *.bc main 12 | -------------------------------------------------------------------------------- /tests/llvm/static/test_global_warnings_instrumentation/Makefile.1: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP = $(LLVM_PASS) -O1 -x cuda --cuda-gpu-arch=sm_60 -g -DFPC_ERRORS_DONT_ABORT 4 | 5 | #LINK = -L${CUDA_PATH}/lib64/ -lcuda -lcudart 6 | 7 | all: 8 | $(CC) -c compute.cu $(OP) 9 | 10 | clean: 11 | rm *.o *.ll *.bc main 12 | -------------------------------------------------------------------------------- /tests/llvm/static/test_global_warnings_instrumentation/Makefile.2: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP = $(LLVM_PASS) -O2 -x cuda --cuda-gpu-arch=sm_60 -g -DFPC_ERRORS_DONT_ABORT 4 | 5 | #LINK = -L${CUDA_PATH}/lib64/ -lcuda -lcudart 6 | 7 | all: 8 | $(CC) -c compute.cu $(OP) 9 | 10 | clean: 11 | rm *.o *.ll *.bc main 12 | -------------------------------------------------------------------------------- /tests/llvm/static/test_global_warnings_instrumentation/Makefile.3: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP = $(LLVM_PASS) -O3 -x cuda --cuda-gpu-arch=sm_60 -g -DFPC_ERRORS_DONT_ABORT 4 | 5 | #LINK = -L${CUDA_PATH}/lib64/ -lcuda -lcudart 6 | 7 | all: 8 | $(CC) -c compute.cu $(OP) 9 | 10 | clean: 11 | rm *.o *.ll *.bc main 12 | -------------------------------------------------------------------------------- /tests/llvm/static/test_global_warnings_instrumentation/compute.cu: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | __device__ 5 | double power(double x) 6 | { 7 | double y = (x-x)/(x-x); 8 | return x*x + 2.0 + y; 9 | } 10 | 11 | __global__ 12 | void compute(double x) 13 | { 14 | double y = power(x); 15 | y = y + x; 16 | int tid = blockIdx.x * blockDim.x + threadIdx.x; 17 | 18 | if (tid == 0) { 19 | printf("y: %f\n", y); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /tests/llvm/static/test_main_is_found/Makefile: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP = $(LLVM_PASS) -O0 -x cuda --cuda-gpu-arch=sm_60 -g 4 | 5 | #LINK = -L${CUDA_PATH}/lib64/ -lcuda -lcudart 6 | 7 | all: 8 | $(CC) -c compute.cu $(OP) 9 | 10 | clean: 11 | rm -rf *.o __pycache__ 12 | -------------------------------------------------------------------------------- /tests/llvm/static/test_main_is_found/compute.cu: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | __device__ 5 | double power(double x) 6 | { 7 | double y = (x-x)/(x-x); 8 | return x*x + 2.0 + y; 9 | } 10 | 11 | __global__ 12 | void compute(double x) 13 | { 14 | double y = power(x); 15 | y = y + x; 16 | int tid = blockIdx.x * blockDim.x + threadIdx.x; 17 | 18 | if (tid == 0) { 19 | printf("y: %f\n", y); 20 | } 21 | } 22 | 23 | int main() 24 | { 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /tests/llvm/static/test_main_is_found/get_llvm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | 3 | clang++ -emit-llvm -c compute.cu \ 4 | -include Runtime.h -I/Users/lagunaperalt1/projects/fpchecker/code/tests/llvm/static/test_main_is_found/../../../../src -O0 -x cuda --cuda-gpu-arch=sm_60 -g 5 | llvm-dis -f compute.bc -o compute.ll 6 | -------------------------------------------------------------------------------- /tests/llvm/static/test_number_fp_operations/Makefile: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.config 2 | 3 | OP = $(LLVM_PASS) -O0 -x cuda --cuda-gpu-arch=sm_60 -g 4 | 5 | #LINK = -L${CUDA_PATH}/lib64/ -lcuda -lcudart 6 | 7 | all: 8 | $(CC) -c compute.cu $(OP) 9 | 10 | clean: 11 | rm -rf *.o __pycache__ 12 | -------------------------------------------------------------------------------- /tests/llvm/static/test_number_fp_operations/compute.cu: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | __device__ 5 | double power(double x) 6 | { 7 | double y = (x-x)/(x-x); 8 | return x*x + 2.0 + y; 9 | } 10 | 11 | __global__ 12 | void compute(double x) 13 | { 14 | double y = power(x); 15 | y = y + x; 16 | int tid = blockIdx.x * blockDim.x + threadIdx.x; 17 | 18 | if (tid == 0) { 19 | printf("y: %f\n", y); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /tests/llvm/static/test_simple_cuda/compute.cu: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | __device__ 5 | double power(double x) 6 | { 7 | double y = (x-x)/(x-x); 8 | return x*x + 2.0 + y; 9 | } 10 | 11 | __global__ 12 | void compute(double x) 13 | { 14 | double y = power(x); 15 | y = y + x; 16 | int tid = blockIdx.x * blockDim.x + threadIdx.x; 17 | 18 | if (tid == 0) { 19 | printf("y: %f\n", y); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /tests/llvm/static/test_simple_cuda/compute.h: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | __device__ 5 | double power(double x); 6 | 7 | __global__ 8 | void compute(double x); 9 | -------------------------------------------------------------------------------- /tests/llvm/static/test_simple_cuda/get_ir.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | 3 | clang++ -DFPC_ERRORS_DONT_ABORT -c compute.cu -Xclang -load -Xclang /Users/lagunaperalt1/projects/fpchecker/code/tests/static/test_simple_cuda/../../../build/libfpchecker.dylib -include Runtime.h -I/Users/lagunaperalt1/projects/fpchecker/code/tests/static/test_simple_cuda/../../../src -O3 -x cuda --cuda-gpu-arch=sm_60 -g -emit-llvm 4 | 5 | llvm-dis -f compute-cuda-nvptx64-nvidia-cuda-sm_60.bc -o compute-cuda-nvptx64-nvidia-cuda-sm_60.ll 6 | -------------------------------------------------------------------------------- /tests/llvm/static/test_simple_cuda/get_node_with_GPU.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | 3 | bsub -G guests -Is bash 4 | -------------------------------------------------------------------------------- /tests/llvm/static/test_simple_cuda/main.cu: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include "compute.h" 4 | 5 | int main(int argc, char **argv) 6 | { 7 | printf("Calling kernel\n"); 8 | double x = atof(argv[1]); 9 | compute<<<128,128>>>(x); 10 | cudaDeviceSynchronize(); 11 | printf("done"); 12 | 13 | return 0; 14 | } 15 | -------------------------------------------------------------------------------- /tests/parser/dynamic/test_fp64_almost_overflow_found_dont_abort/Makefile.1: -------------------------------------------------------------------------------- 1 | NVCC=FPC_INSTRUMENT=1 nvcc-fpc -std=c++11 -DFPC_DANGER_ZONE_PERCENT=0.15 -DFPC_ENABLE_WARNINGS 2 | 3 | all: 4 | cp -f dot_product.cu.orig dot_product.cu 5 | cp -f main.cu.orig main.cu 6 | $(NVCC) -arch=sm_60 -O0 -c dot_product.cu 7 | $(NVCC) -arch=sm_60 -O0 -c main.cu 8 | $(NVCC) -o main dot_product.o main.o 9 | 10 | clean: 11 | rm -rf *.cu *.o main __pycache__ *.ii .fpc_log.txt 12 | 13 | -------------------------------------------------------------------------------- /tests/parser/dynamic/test_fp64_almost_overflow_found_dont_abort/Makefile.2: -------------------------------------------------------------------------------- 1 | NVCC=FPC_INSTRUMENT=1 nvcc-fpc -std=c++11 -DFPC_DANGER_ZONE_PERCENT=0.05 -DFPC_ENABLE_WARNINGS 2 | 3 | all: 4 | cp -f dot_product.cu.orig dot_product.cu 5 | cp -f main.cu.orig main.cu 6 | $(NVCC) -arch=sm_60 -O0 -c dot_product.cu 7 | $(NVCC) -arch=sm_60 -O0 -c main.cu 8 | $(NVCC) -o main dot_product.o main.o 9 | 10 | clean: 11 | rm -rf *.cu *.o main __pycache__ *.ii .fpc_log.txt 12 | 13 | -------------------------------------------------------------------------------- /tests/parser/dynamic/test_fp64_almost_overflow_found_dont_abort/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(double a, double b, double *res); 4 | 5 | __global__ void dot_prod(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tests/parser/dynamic/test_fp64_almost_underflow_found/Makefile.1: -------------------------------------------------------------------------------- 1 | NVCC=FPC_INSTRUMENT=1 nvcc-fpc -std=c++11 -DFPC_DANGER_ZONE_PERCENT=0.15 -DFPC_ENABLE_WARNINGS -DFPC_ERRORS_ABORT 2 | 3 | all: 4 | cp -f dot_product.cu.orig dot_product.cu 5 | cp -f main.cu.orig main.cu 6 | $(NVCC) -arch=sm_60 -O0 -c dot_product.cu 7 | $(NVCC) -arch=sm_60 -O0 -c main.cu 8 | $(NVCC) -o main dot_product.o main.o 9 | 10 | clean: 11 | rm -rf *.cu *.o main __pycache__ *.ii .fpc_log.txt 12 | 13 | -------------------------------------------------------------------------------- /tests/parser/dynamic/test_fp64_almost_underflow_found/Makefile.2: -------------------------------------------------------------------------------- 1 | NVCC=FPC_INSTRUMENT=1 nvcc-fpc -std=c++11 -DFPC_DANGER_ZONE_PERCENT=0.05 -DFPC_ENABLE_WARNINGS -DFPC_ERRORS_ABORT 2 | 3 | all: 4 | cp -f dot_product.cu.orig dot_product.cu 5 | cp -f main.cu.orig main.cu 6 | $(NVCC) -arch=sm_60 -O0 -c dot_product.cu 7 | $(NVCC) -arch=sm_60 -O0 -c main.cu 8 | $(NVCC) -o main dot_product.o main.o 9 | 10 | clean: 11 | rm -rf *.cu *.o main __pycache__ *.ii .fpc_log.txt 12 | 13 | -------------------------------------------------------------------------------- /tests/parser/dynamic/test_fp64_almost_underflow_found/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(double a, double b, double *res); 4 | 5 | __global__ void dot_prod(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tests/parser/dynamic/test_fp64_almost_underflow_found_dont_abort/Makefile.1: -------------------------------------------------------------------------------- 1 | NVCC=FPC_INSTRUMENT=1 nvcc-fpc -std=c++11 -DFPC_DANGER_ZONE_PERCENT=0.15 -DFPC_ENABLE_WARNINGS 2 | 3 | all: 4 | cp -f dot_product.cu.orig dot_product.cu 5 | cp -f main.cu.orig main.cu 6 | $(NVCC) -arch=sm_60 -O0 -c dot_product.cu 7 | $(NVCC) -arch=sm_60 -O0 -c main.cu 8 | $(NVCC) -o main dot_product.o main.o 9 | 10 | clean: 11 | rm -rf *.cu *.o main __pycache__ *.ii .fpc_log.txt 12 | 13 | 14 | -------------------------------------------------------------------------------- /tests/parser/dynamic/test_fp64_almost_underflow_found_dont_abort/Makefile.2: -------------------------------------------------------------------------------- 1 | NVCC=FPC_INSTRUMENT=1 nvcc-fpc -std=c++11 -DFPC_DANGER_ZONE_PERCENT=0.05 -DFPC_ENABLE_WARNINGS 2 | 3 | all: 4 | cp -f dot_product.cu.orig dot_product.cu 5 | cp -f main.cu.orig main.cu 6 | $(NVCC) -arch=sm_60 -O0 -c dot_product.cu 7 | $(NVCC) -arch=sm_60 -O0 -c main.cu 8 | $(NVCC) -o main dot_product.o main.o 9 | 10 | clean: 11 | rm -rf *.cu *.o main __pycache__ *.ii .fpc_log.txt 12 | 13 | -------------------------------------------------------------------------------- /tests/parser/dynamic/test_fp64_almost_underflow_found_dont_abort/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(double a, double b, double *res); 4 | 5 | __global__ void dot_prod(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tests/parser/dynamic/test_fp64_nan_found/Makefile: -------------------------------------------------------------------------------- 1 | 2 | NVCC=FPC_INSTRUMENT=1 nvcc-fpc -std=c++11 -DFPC_ERRORS_ABORT 3 | 4 | all: 5 | cp -f dot_product.cu.orig dot_product.cu 6 | cp -f main.cu.orig main.cu 7 | $(NVCC) -arch=sm_60 -O0 -c dot_product.cu 8 | $(NVCC) -arch=sm_60 -O0 -c main.cu 9 | $(NVCC) -o main dot_product.o main.o 10 | 11 | clean: 12 | rm -rf *.cu *.o main __pycache__ *.ii .fpc_log.txt 13 | 14 | -------------------------------------------------------------------------------- /tests/parser/dynamic/test_fp64_nan_found/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(double a, double b, double *res); 4 | 5 | __global__ void dot_prod(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tests/parser/dynamic/test_fp64_nan_found_dont_abort/Makefile: -------------------------------------------------------------------------------- 1 | NVCC=FPC_INSTRUMENT=1 nvcc-fpc -std=c++11 -DFPC_DISABLE_SUBNORMAL 2 | 3 | all: 4 | cp -f dot_product.cu.orig dot_product.cu 5 | cp -f main.cu.orig main.cu 6 | $(NVCC) -arch=sm_60 -O0 -c dot_product.cu 7 | $(NVCC) -arch=sm_60 -O0 -c main.cu 8 | $(NVCC) -o main dot_product.o main.o 9 | 10 | clean: 11 | rm -rf *.cu *.o main __pycache__ *.ii .fpc_log.txt 12 | -------------------------------------------------------------------------------- /tests/parser/dynamic/test_fp64_nan_found_dont_abort/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(double a, double b, double *res); 4 | 5 | __global__ void dot_prod(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tests/parser/dynamic/test_fp64_overflow_found/Makefile.1: -------------------------------------------------------------------------------- 1 | NVCC=FPC_INSTRUMENT=1 nvcc-fpc -std=c++11 -DFPC_ERRORS_ABORT 2 | 3 | all: 4 | cp -f dot_product.cu.orig dot_product.cu 5 | cp -f main.cu.orig main.cu 6 | $(NVCC) -arch=sm_60 -O0 -c dot_product.cu 7 | $(NVCC) -arch=sm_60 -O0 -c main.cu 8 | $(NVCC) -o main dot_product.o main.o 9 | 10 | clean: 11 | rm -rf *.cu *.o main __pycache__ *.ii .fpc_log.txt 12 | 13 | -------------------------------------------------------------------------------- /tests/parser/dynamic/test_fp64_overflow_found/Makefile.2: -------------------------------------------------------------------------------- 1 | NVCC=FPC_INSTRUMENT=1 nvcc-fpc -std=c++11 -DFPC_ERRORS_ABORT 2 | 3 | all: 4 | cp -f dot_product.cu.orig dot_product.cu 5 | cp -f main.cu.orig main.cu 6 | $(NVCC) -arch=sm_60 -O0 -c dot_product.cu 7 | $(NVCC) -arch=sm_60 -O0 -c main.cu 8 | $(NVCC) -o main dot_product.o main.o 9 | 10 | clean: 11 | rm -rf *.cu *.o main __pycache__ *.ii .fpc_log.txt 12 | 13 | 14 | -------------------------------------------------------------------------------- /tests/parser/dynamic/test_fp64_overflow_found/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(double a, double b, double *res); 4 | 5 | __global__ void dot_prod(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tests/parser/dynamic/test_fp64_overflow_found_dont_abort/Makefile: -------------------------------------------------------------------------------- 1 | NVCC=FPC_INSTRUMENT=1 nvcc-fpc -std=c++11 -DFPC_DISABLE_SUBNORMAL 2 | 3 | all: 4 | cp -f dot_product.cu.orig dot_product.cu 5 | cp -f main.cu.orig main.cu 6 | $(NVCC) -arch=sm_60 -O0 -c dot_product.cu 7 | $(NVCC) -arch=sm_60 -O0 -c main.cu 8 | $(NVCC) -o main dot_product.o main.o 9 | 10 | clean: 11 | rm -rf *.cu *.o main __pycache__ *.ii .fpc_log.txt 12 | 13 | 14 | -------------------------------------------------------------------------------- /tests/parser/dynamic/test_fp64_overflow_found_dont_abort/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(double a, double b, double *res); 4 | 5 | __global__ void dot_prod(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tests/parser/dynamic/test_fp64_underflow_found/Makefile: -------------------------------------------------------------------------------- 1 | 2 | NVCC=FPC_INSTRUMENT=1 nvcc-fpc -std=c++11 -DFPC_ERRORS_ABORT 3 | 4 | all: 5 | cp -f dot_product.cu.orig dot_product.cu 6 | cp -f main.cu.orig main.cu 7 | $(NVCC) -arch=sm_60 -O0 -c dot_product.cu 8 | $(NVCC) -arch=sm_60 -O0 -c main.cu 9 | $(NVCC) -o main dot_product.o main.o 10 | 11 | clean: 12 | rm -rf *.cu *.o main __pycache__ *.ii .fpc_log.txt 13 | 14 | -------------------------------------------------------------------------------- /tests/parser/dynamic/test_fp64_underflow_found/compute.h: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | __device__ 5 | double power(double x); 6 | 7 | __global__ 8 | void compute(double x); 9 | -------------------------------------------------------------------------------- /tests/parser/dynamic/test_fp64_underflow_found/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(double a, double b, double *res); 4 | 5 | __global__ void dot_prod(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tests/parser/dynamic/test_fp64_underflow_found_dont_abort/Makefile: -------------------------------------------------------------------------------- 1 | NVCC=FPC_INSTRUMENT=1 nvcc-fpc -std=c++11 2 | 3 | all: 4 | cp -f dot_product.cu.orig dot_product.cu 5 | cp -f main.cu.orig main.cu 6 | $(NVCC) -arch=sm_60 -O0 -c dot_product.cu 7 | $(NVCC) -arch=sm_60 -O0 -c main.cu 8 | $(NVCC) -o main dot_product.o main.o 9 | 10 | clean: 11 | rm -rf *.cu *.o main __pycache__ *.ii .fpc_log.txt 12 | 13 | 14 | -------------------------------------------------------------------------------- /tests/parser/dynamic/test_fp64_underflow_found_dont_abort/compute.h: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | __device__ 5 | double power(double x); 6 | 7 | __global__ 8 | void compute(double x); 9 | -------------------------------------------------------------------------------- /tests/parser/dynamic/test_fp64_underflow_found_dont_abort/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(double a, double b, double *res); 4 | 5 | __global__ void dot_prod(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tests/parser/dynamic/test_intercept_make/Makefile: -------------------------------------------------------------------------------- 1 | 2 | all: 3 | cd src && $(MAKE) 4 | 5 | clean: 6 | cd src && $(MAKE) clean 7 | -------------------------------------------------------------------------------- /tests/parser/dynamic/test_intercept_make/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/parser/dynamic/test_intercept_make/__init__.py -------------------------------------------------------------------------------- /tests/parser/dynamic/test_intercept_make/src/Makefile: -------------------------------------------------------------------------------- 1 | #include ../../../Makefile.config 2 | 3 | all: 4 | cd dir && $(MAKE) 5 | 6 | clean: 7 | cd dir && $(MAKE) clean 8 | -------------------------------------------------------------------------------- /tests/parser/dynamic/test_intercept_make/src/dir/Makefile: -------------------------------------------------------------------------------- 1 | OP = -O0 -x cu -arch=sm_70 -g -std=c++11 -DFPC_ERRORS_ABORT 2 | 3 | all: 4 | nvcc $(OP) -c dot_product.cu 5 | nvcc $(OP) -c main.cu 6 | nvcc -o main dot_product.o main.o 7 | 8 | clean: 9 | rm -rf *.o main __pycache__ *_copy.* main_fpc *_inst.* *.ii .fpc_log.txt 10 | -------------------------------------------------------------------------------- /tests/parser/dynamic/test_intercept_make/src/dir/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(double a, double b, double *res); 4 | 5 | __global__ void dot_prod(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tests/parser/static/test_compile_derived_types/.fpc_log.txt: -------------------------------------------------------------------------------- 1 | Instrumented: simple_inst.cu 2 | -------------------------------------------------------------------------------- /tests/parser/static/test_compile_derived_types/Makefile: -------------------------------------------------------------------------------- 1 | 2 | 3 | NVCC = ../../../../parser/nvcc-fpc 4 | 5 | all: 6 | $(NVCC) -std=c++11 -c -arch=sm_70 -O0 simple.cu 7 | 8 | clean: 9 | rm -rf *.o 10 | -------------------------------------------------------------------------------- /tests/parser/static/test_compile_derived_types/simple.cu: -------------------------------------------------------------------------------- 1 | 2 | #include "simple.hpp" 3 | 4 | namespace MySpace { 5 | 6 | __device__ void compute(Real_ptr x) { 7 | x[0] = x[1] * x[2]; 8 | } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /tests/parser/static/test_compile_derived_types/simple.hpp: -------------------------------------------------------------------------------- 1 | 2 | namespace MySpace { 3 | 4 | using Real_type = double; 5 | using Real_ptr = Real_type*; 6 | 7 | } 8 | -------------------------------------------------------------------------------- /tests/parser/static/test_compile_derived_types/simple_inst.cu: -------------------------------------------------------------------------------- 1 | 2 | #include "simple.hpp" 3 | 4 | namespace MySpace { 5 | 6 | __device__ void compute(Real_ptr x) { 7 | x[0] = _FPC_CHECK_D_(x[1] * x[2], 7, "simple.cu"); 8 | } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /tests/parser/static/test_deprocess_empty/newFile.cpp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /tests/parser/static/test_instrument_comments/newFile.cpp: -------------------------------------------------------------------------------- 1 | 2 | __device__ void comp(double *x) { 3 | double y=0.0, z; 4 | x[0] = y*z; 5 | 6 | 7 | } 8 | -------------------------------------------------------------------------------- /tests/parser/static/test_instrument_lambda/Makefile: -------------------------------------------------------------------------------- 1 | 2 | NVCC = nvcc-fpc 3 | 4 | all: 5 | FPC_INSTRUMENT=1 $(NVCC) --expt-extended-lambda -std=c++11 -c -O0 -arch=sm_70 compute.cu 6 | 7 | clean: 8 | rm -rf *.o *_inst.* *.ii .fpc_log.txt 9 | -------------------------------------------------------------------------------- /tests/parser/static/test_instrument_lambda/compute.cu: -------------------------------------------------------------------------------- 1 | 2 | void compute(float *x, float *y, float a, int N) { 3 | auto r = 0; 4 | 5 | auto lambda = [=] __host__ __device__ (int i) { 6 | y[i] = a * x[i] + y[i]; 7 | }; 8 | 9 | auto lambda2 = [=] __host__ __device__ { 10 | double z=3.3; 11 | z = z*z; 12 | return y[0] + z; 13 | }; 14 | } 15 | 16 | -------------------------------------------------------------------------------- /tests/parser/static/test_instrument_macro/config.ini: -------------------------------------------------------------------------------- 1 | [omit] 2 | omit_lines = prog_1.cu:10-19 3 | 4 | -------------------------------------------------------------------------------- /tests/parser/static/test_instrument_multiline_macro/config.ini: -------------------------------------------------------------------------------- 1 | [omit] 2 | omit_lines = prog_1.cu:10-19 3 | 4 | -------------------------------------------------------------------------------- /tests/parser/static/test_instrument_templates/Makefile: -------------------------------------------------------------------------------- 1 | 2 | NVCC = nvcc-fpc 3 | 4 | all: 5 | FPC_INSTRUMENT=1 $(NVCC) -std=c++11 -c -O0 -arch=sm_70 compute.cu 6 | 7 | clean: 8 | rm -rf *.o *_inst.* *.ii .fpc_log.txt 9 | -------------------------------------------------------------------------------- /tests/parser/static/test_instrument_templates/compute.cu: -------------------------------------------------------------------------------- 1 | 2 | #include "header.hpp" 3 | 4 | __device__ double calculate(double x, double y, double z) { 5 | 6 | double ret = calc(x,y,z); 7 | ret = 1.0 + ret; 8 | return ret; 9 | } 10 | -------------------------------------------------------------------------------- /tests/parser/static/test_instrument_templates/header.hpp: -------------------------------------------------------------------------------- 1 | 2 | template 3 | __device__ 4 | double calc(T x, T y, T z) { 5 | T ret = x*y; 6 | ret = ret / z; 7 | return ret; 8 | } 9 | 10 | -------------------------------------------------------------------------------- /tests/parser/static/test_match_device_host_spaces/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(double a, double b, double *res); 4 | 5 | __global__ void dot_prod(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tests/parser/static/test_tokenize_chars/simple.cu: -------------------------------------------------------------------------------- 1 | 2 | __device__ 3 | void compute() { 4 | printf("abc \n\n "); 5 | char x = '\0'; 6 | } 7 | -------------------------------------------------------------------------------- /tests/parser/static/test_tokenize_simple/simple.cu: -------------------------------------------------------------------------------- 1 | 2 | __device__ 3 | void compute(double *x) { 4 | x[0] = 0; 5 | } 6 | -------------------------------------------------------------------------------- /tests/parser/static/test_tokenize_strings/simple.cu: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | __device__ static std::string var = ""; 5 | 6 | __device__ 7 | void compute() { 8 | printf("abc \n\n "); 9 | } 10 | -------------------------------------------------------------------------------- /tests/tests.sh: -------------------------------------------------------------------------------- 1 | 2 | echo "*** static tests ***" 3 | python -m pytest -v ./tests/static/ 4 | 5 | echo "*** dynamic tests ***" 6 | python -m pytest -v ./tests/dynamic/ 7 | -------------------------------------------------------------------------------- /tests/tests_Makefile.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | CC = @CMAKE_CXX_COMPILER@ 4 | FPCHECKER_PATH = @CMAKE_BINARY_DIR@ 5 | LLVM_PASS = -Xclang -load -Xclang $(FPCHECKER_PATH)/@CMAKE_SHARED_LIBRARY_PREFIX@@PROJECT_NAME@@CMAKE_SHARED_LIBRARY_SUFFIX@ \ 6 | -include Runtime.h -I$(FPCHECKER_PATH)/src 7 | 8 | -------------------------------------------------------------------------------- /tests/tracing_tool/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/tracing_tool/__init__.py -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/tracing_tool/dynamic/__init__.py -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_assign_to_reference/Makefile: -------------------------------------------------------------------------------- 1 | #include ../../../Makefile.config 2 | 3 | #OP = $(CLANG_PASS) -emit-llvm -O0 -x cuda --cuda-gpu-arch=sm_60 -g 4 | OP = -O0 -x cu -arch=sm_70 -g 5 | 6 | all: 7 | nvcc $(OP) -c dot_product.cu 8 | nvcc $(OP) -c main.cu 9 | nvcc -o main dot_product.o main.o 10 | 11 | clean: 12 | rm -rf *.o main __pycache__ *_copy.* main_fpc 13 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_assign_to_reference/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/tracing_tool/dynamic/test_assign_to_reference/__init__.py -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_assign_to_reference/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(double a, double b, double *res); 4 | 5 | __global__ void dot_prod(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_chdir/Makefile: -------------------------------------------------------------------------------- 1 | #include ../../../Makefile.config 2 | 3 | #OP = $(CLANG_PASS) -emit-llvm -O0 -x cuda --cuda-gpu-arch=sm_60 -g 4 | OP = -O0 -x cu -arch=sm_70 -g 5 | 6 | all: 7 | cd src; nvcc $(OP) -c dot_product.cu 8 | cd src; nvcc $(OP) -c main.cu 9 | cd src; nvcc -o main dot_product.o main.o 10 | 11 | clean: 12 | rm -rf src/*.o src/main __pycache__ src/*_copy.* src/main_fpc 13 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_chdir/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/tracing_tool/dynamic/test_chdir/__init__.py -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_chdir/src/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(double a, double b, double *res); 4 | 5 | __global__ void dot_prod(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_class_members/Makefile: -------------------------------------------------------------------------------- 1 | #include ../../../Makefile.config 2 | 3 | #OP = $(CLANG_PASS) -emit-llvm -O0 -x cuda --cuda-gpu-arch=sm_60 -g 4 | OP = -O0 -x cu -arch=sm_70 -g -std=c++11 5 | 6 | all: 7 | nvcc $(OP) -c circle.cpp 8 | nvcc $(OP) -c compute.cu 9 | nvcc $(OP) -c main.cu 10 | nvcc -o main compute.o main.o circle.o 11 | 12 | clean: 13 | rm -rf *.o main __pycache__ *_copy.* main_fpc 14 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_class_members/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/tracing_tool/dynamic/test_class_members/__init__.py -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_class_members/circle.cpp: -------------------------------------------------------------------------------- 1 | #include "circle.h" 2 | #include 3 | 4 | double Circle::radius() { 5 | return r*r; 6 | } 7 | 8 | double Circle::calcRadius() { 9 | double ret; 10 | ret = Circle::radius(); 11 | double x; 12 | x = Circle::staticRadius(); 13 | return ret+x; 14 | } 15 | 16 | double Circle::staticRadius() { 17 | return 1.3; 18 | } 19 | 20 | void circle() { 21 | Circle c; 22 | double r = c.calcRadius(); 23 | printf("Radius: %f\n", r); 24 | } 25 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_class_members/circle.h: -------------------------------------------------------------------------------- 1 | class Circle { 2 | double r = 0.0; 3 | private: 4 | double radius(); 5 | 6 | public: 7 | double calcRadius(); 8 | static double staticRadius(); 9 | 10 | }; 11 | 12 | void circle(); 13 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_class_members/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(double a, double b, double *res); 4 | 5 | __global__ void compute(double *x, double *y, int size); 6 | 7 | /*class Circle { 8 | double r = 0.0; 9 | private: 10 | double radius(); 11 | 12 | public: 13 | double calcRadius(); 14 | 15 | }; 16 | 17 | void circle(); 18 | */ 19 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_cmake_cuda/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.8 FATAL_ERROR) 2 | project(cmake_and_cuda LANGUAGES CXX CUDA) 3 | 4 | add_subdirectory(src) 5 | 6 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_cmake_cuda/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/tracing_tool/dynamic/test_cmake_cuda/__init__.py -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_cmake_cuda/src/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(double a, double b, double *res); 4 | 5 | __global__ void compute(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_cmake_multidir/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION "3.9.1") 2 | 3 | project("server") 4 | 5 | add_subdirectory(src) 6 | 7 | #add_executable("${PROJECT_NAME}" "src/main.cpp") 8 | 9 | #install(TARGETS "${PROJECT_NAME}" DESTINATION bin) 10 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_cmake_multidir/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/tracing_tool/dynamic/test_cmake_multidir/__init__.py -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_cmake_multidir/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION "3.9.1") 2 | project(main_exe) 3 | 4 | add_subdirectory(util) 5 | add_subdirectory(core) 6 | 7 | include_directories(util core) 8 | 9 | set(main_source_files main.cpp) 10 | add_executable(main_program ${main_source_files}) 11 | 12 | target_link_libraries(main_program server) 13 | # also transitively gets the "js" and "util" dependencies 14 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_cmake_multidir/src/core/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | set(server_source_files 3 | server.cpp 4 | server.h 5 | ) 6 | add_library(server ${server_source_files}) 7 | 8 | target_link_libraries(server util) 9 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_cmake_multidir/src/core/server.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "server.h" 3 | 4 | double server_compute(double x, double y) { 5 | return x*y; 6 | } 7 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_cmake_multidir/src/core/server.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | double server_compute(double x, double y); 4 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_cmake_multidir/src/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include "util.h" 4 | #include "server.h" 5 | 6 | int main() { 7 | double x = 1.3; 8 | double y = 10.0; 9 | double tmp = compute_util(x, y); 10 | tmp = server_compute(tmp, y); 11 | 12 | printf("simple program: %f\n", tmp); 13 | 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_cmake_multidir/src/util/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | set(util_source_files 3 | util.cpp 4 | util.h 5 | ) 6 | 7 | add_library(util ${util_source_files}) 8 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_cmake_multidir/src/util/util.cpp: -------------------------------------------------------------------------------- 1 | 2 | 3 | #include "util.h" 4 | 5 | double compute_util(double x, double y) { 6 | return x+y; 7 | } 8 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_cmake_multidir/src/util/util.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | double compute_util(double x, double y); 4 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_cmake_ninja_cuda/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.8 FATAL_ERROR) 2 | project(cmake_and_cuda LANGUAGES CXX CUDA) 3 | 4 | add_subdirectory(src) 5 | 6 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_cmake_ninja_cuda/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/tracing_tool/dynamic/test_cmake_ninja_cuda/__init__.py -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_cmake_ninja_cuda/src/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(double a, double b, double *res); 4 | 5 | __global__ void compute(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_diff_object_names/Makefile: -------------------------------------------------------------------------------- 1 | #include ../../../Makefile.config 2 | 3 | #OP = $(CLANG_PASS) -emit-llvm -O0 -x cuda --cuda-gpu-arch=sm_60 -g 4 | OP = -O0 -x cu -arch=sm_70 -g 5 | 6 | all: 7 | nvcc $(OP) -c src/dot_product.cu -o src/dot_product_obj.cu.o 8 | nvcc $(OP) -c src/main.cu -o src/main_obj.cu.o 9 | nvcc -o main src/dot_product_obj.cu.o src/main_obj.cu.o 10 | 11 | clean: 12 | rm -rf src/*.o main __pycache__ src/*_copy.* main_fpc 13 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_diff_object_names/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/tracing_tool/dynamic/test_diff_object_names/__init__.py -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_diff_object_names/src/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(double a, double b, double *res); 4 | 5 | __global__ void dot_prod(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_expression_parser/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/tracing_tool/dynamic/test_expression_parser/__init__.py -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_flat_make/Makefile: -------------------------------------------------------------------------------- 1 | #include ../../../Makefile.config 2 | 3 | #OP = $(CLANG_PASS) -emit-llvm -O0 -x cuda --cuda-gpu-arch=sm_60 -g 4 | OP = -O0 -x cu -arch=sm_70 -g 5 | 6 | all: 7 | nvcc $(OP) -c dot_product.cu 8 | nvcc $(OP) -c main.cu 9 | nvcc -o main dot_product.o main.o 10 | 11 | clean: 12 | rm -rf *.o main __pycache__ *_copy.* main_fpc 13 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_flat_make/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/tracing_tool/dynamic/test_flat_make/__init__.py -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_flat_make/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(double a, double b, double *res); 4 | 5 | __global__ void dot_prod(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_fortran/Makefile: -------------------------------------------------------------------------------- 1 | 2 | all: 3 | cc -c main.c -O1 -I./ 4 | gfortran -c compute.f95 5 | gfortran -o main main.o compute.o 6 | 7 | clean: 8 | rm -rf *.o main __pycache__ *_copy.* main_fpc 9 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_fortran/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/tracing_tool/dynamic/test_fortran/__init__.py -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_fortran/compute.f95: -------------------------------------------------------------------------------- 1 | 2 | 3 | function compute(x, y) result (res) 4 | real*8 :: x 5 | real*8 :: y 6 | 7 | y = x + y 8 | 9 | end function 10 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_fortran/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | double compute_(double *x, double *y); 4 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_fortran/main.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include "compute.h" 4 | 5 | int main() { 6 | 7 | double x = 8.0; 8 | double y = 16.0; 9 | y = compute_(&x, &y); 10 | printf("y = %f\n", y); 11 | 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_fortran_cmake/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION "3.9.1") 2 | 3 | project("main") 4 | 5 | add_subdirectory(src) 6 | 7 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_fortran_cmake/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/tracing_tool/dynamic/test_fortran_cmake/__init__.py -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_fortran_cmake/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION "3.9.1") 2 | project(main_exe) 3 | 4 | add_subdirectory(compute) 5 | 6 | include_directories(compute) 7 | 8 | set(main_source_files main.c) 9 | add_executable(main_program ${main_source_files}) 10 | 11 | target_link_libraries(main_program compute) 12 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_fortran_cmake/src/compute/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | enable_language(Fortran) 3 | 4 | set(compute_source_files 5 | compute.f95 6 | ) 7 | add_library(compute ${compute_source_files}) 8 | 9 | target_link_libraries(compute) 10 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_fortran_cmake/src/compute/compute.f95: -------------------------------------------------------------------------------- 1 | 2 | 3 | function compute(x, y) result (res) 4 | real*8 :: x 5 | real*8 :: y 6 | 7 | y = x + y 8 | 9 | end function 10 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_fortran_cmake/src/compute/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | double compute_(double *x, double *y); 4 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_fortran_cmake/src/main.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include "compute.h" 4 | 5 | int main() { 6 | 7 | double x = 8.0; 8 | double y = 16.0; 9 | y = compute_(&x, &y); 10 | printf("y = %f\n", y); 11 | 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_fortran_cmake_openmp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION "3.9.1") 2 | 3 | project("main") 4 | 5 | add_subdirectory(src) 6 | 7 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_fortran_cmake_openmp/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/tracing_tool/dynamic/test_fortran_cmake_openmp/__init__.py -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_fortran_cmake_openmp/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION "3.9.1") 2 | project(main_exe) 3 | 4 | add_subdirectory(compute) 5 | 6 | include_directories(compute) 7 | 8 | add_link_options(-fopenmp) 9 | 10 | set(main_source_files main.c) 11 | add_executable(main_program ${main_source_files}) 12 | 13 | 14 | target_link_libraries(main_program compute -lgfortran) 15 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_fortran_cmake_openmp/src/compute/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | enable_language(Fortran) 3 | 4 | add_compile_options(-fopenmp) 5 | add_link_options(-fopenmp) 6 | 7 | set(compute_source_files 8 | compute.f95 9 | ) 10 | add_library(compute ${compute_source_files}) 11 | 12 | target_link_libraries(compute) 13 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_fortran_cmake_openmp/src/compute/compute.f95: -------------------------------------------------------------------------------- 1 | 2 | 3 | function compute() result(N) 4 | implicit none 5 | 6 | integer :: N ! Shared 7 | 8 | N = 1001 9 | print *, "Before parallel section: N = ", N 10 | 11 | !$OMP PARALLEL 12 | N = N + 1 13 | print *, "Inside parallel section: N = ", N 14 | !$OMP END PARALLEL 15 | 16 | print *, "After parallel section: N = ", N 17 | 18 | end function compute 19 | 20 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_fortran_cmake_openmp/src/compute/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | void compute_(); 4 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_fortran_cmake_openmp/src/main.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include "compute.h" 4 | 5 | int main() { 6 | 7 | compute_(); 8 | 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_fortran_xl/Makefile: -------------------------------------------------------------------------------- 1 | 2 | all: 3 | xlc -c main.c -O1 -I./ 4 | xlf -c compute.f95 5 | xlc -o main main.o compute.o 6 | 7 | clean: 8 | rm -rf *.o main __pycache__ *_copy.* main_fpc 9 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_fortran_xl/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/tracing_tool/dynamic/test_fortran_xl/__init__.py -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_fortran_xl/compute.f95: -------------------------------------------------------------------------------- 1 | 2 | 3 | function compute(x, y) result (res) 4 | real*8 :: x 5 | real*8 :: y 6 | 7 | y = x + y 8 | 9 | end function 10 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_fortran_xl/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | double compute(double *x, double *y); 4 | //double compute(double x, double y); 5 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_fortran_xl/main.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include "compute.h" 4 | 5 | int main() { 6 | 7 | double x = 8.0; 8 | double y = 16.0; 9 | y = compute(&x, &y); 10 | //y = compute(x, y); 11 | printf("y = %f\n", y); 12 | 13 | return 0; 14 | } 15 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_lvalue_error/Makefile: -------------------------------------------------------------------------------- 1 | 2 | 3 | all: 4 | nvcc -x cu -arch=sm_70 -c test.cpp 5 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_lvalue_error/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/tracing_tool/dynamic/test_lvalue_error/__init__.py -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_lvalue_error/test.cpp: -------------------------------------------------------------------------------- 1 | 2 | 3 | /* 4 | * 5 | * 6 | * 7 | * 8 | * 9 | * 10 | * 11 | * 12 | * */ 13 | 14 | #include 15 | #include 16 | 17 | class Timer { 18 | 19 | }; 20 | 21 | void start(std::string const &name){ 22 | std::map timers; 23 | Timer &timer = timers[name]; 24 | 25 | 26 | 27 | /* 28 | * 29 | * 30 | * 31 | * 32 | * 33 | * 34 | * */ 35 | 36 | 37 | 38 | } 39 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_lvalue_error/test_copy.cpp: -------------------------------------------------------------------------------- 1 | 2 | 3 | /* 4 | * 5 | * 6 | * 7 | * 8 | * 9 | * 10 | * 11 | * 12 | * */ 13 | 14 | #include 15 | #include 16 | 17 | class Timer { 18 | 19 | }; 20 | 21 | void start(std::string const &name){ 22 | std::map timers; 23 | Timer &timer = _FPC_CHECK_( timers[name], 26, "test_copy.cpp..."); 24 | /* 25 | * 26 | * 27 | * 28 | * 29 | * 30 | * 31 | * */ 32 | 33 | 34 | 35 | } 36 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_mkdir/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/tracing_tool/dynamic/test_mkdir/__init__.py -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_mkdir/src/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(double a, double b, double *res); 4 | 5 | __global__ void dot_prod(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_mpi_and_nvcc/Makefile: -------------------------------------------------------------------------------- 1 | #include ../../../Makefile.config 2 | 3 | #OP = $(CLANG_PASS) -emit-llvm -O0 -x cuda --cuda-gpu-arch=sm_60 -g 4 | OP = -O0 -x cu -arch=sm_70 -g 5 | MPICC=mpixlc 6 | 7 | all: 8 | nvcc $(OP) -c dot_product.cu 9 | nvcc $(OP) -c main.cu -ccbin=$(MPICC) 10 | $(MPICC) -o main dot_product.o main.o -L$(CUDA_HOME)/lib64 -lcudart 11 | 12 | clean: 13 | rm -rf *.o main __pycache__ *_copy.* main_fpc 14 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_mpi_and_nvcc/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/tracing_tool/dynamic/test_mpi_and_nvcc/__init__.py -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_mpi_and_nvcc/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(double a, double b, double *res); 4 | 5 | __global__ void dot_prod(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_mpicc_compiler/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/tracing_tool/dynamic/test_mpicc_compiler/__init__.py -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_mpicc_compiler/src/cuda_launch.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef MAIN_CUDA_H_ 3 | #define MAIN_CUDA_H_ 4 | 5 | void launch(); 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_mpicc_compiler/src/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(double a, double b, double *res); 4 | 5 | __global__ void dot_prod(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_mpicc_compiler/src/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include "mpi_stuff.h" 5 | #include "cuda_launch.h" 6 | 7 | int main(int argc, char **argv) 8 | { 9 | 10 | initMPI(&argc, &argv); 11 | 12 | launch(); 13 | 14 | finalizeMPI(); 15 | 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_mpicc_compiler/src/mpi_stuff.cpp: -------------------------------------------------------------------------------- 1 | 2 | //#include 3 | #include "mpi_stuff.h" 4 | 5 | void initMPI(int *argc, char ***argv) { 6 | //MPI_Init(argc, argv); 7 | } 8 | 9 | void finalizeMPI() { 10 | //MPI_Finalize(); 11 | } 12 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_mpicc_compiler/src/mpi_stuff.h: -------------------------------------------------------------------------------- 1 | 2 | //#include 3 | 4 | void initMPI(int *argc, char ***argv); 5 | void finalizeMPI(); 6 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_multidir/Makefile: -------------------------------------------------------------------------------- 1 | #include ../../../Makefile.config 2 | 3 | all: 4 | cd src && $(MAKE) 5 | 6 | clean: 7 | cd src && $(MAKE) clean 8 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_multidir/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/tracing_tool/dynamic/test_multidir/__init__.py -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_multidir/src/dir1/dir2/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(double a, double b, double *res); 4 | 5 | __global__ void dot_prod(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_nvcc_flags/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/tracing_tool/dynamic/test_nvcc_flags/__init__.py -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_nvcc_flags/src/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(double a, double b, double *res); 4 | 5 | __global__ void dot_prod(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_nvcc_parser/Makefile: -------------------------------------------------------------------------------- 1 | #include ../../../Makefile.config 2 | 3 | #OP = $(CLANG_PASS) -emit-llvm -O0 -x cuda --cuda-gpu-arch=sm_60 -g 4 | OP = -O0 -x cu -arch=sm_70 -g 5 | 6 | all: 7 | nvcc $(OP) -c dot_product.cu 8 | nvcc $(OP) -c main.cu 9 | nvcc -o main dot_product.o main.o 10 | 11 | clean: 12 | rm -rf *.o main __pycache__ *_copy.* main_fpc 13 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_nvcc_parser/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/tracing_tool/dynamic/test_nvcc_parser/__init__.py -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_nvcc_parser/include/lib.h: -------------------------------------------------------------------------------- 1 | 2 | __device__ double foo(double x) { 3 | return x; 4 | } 5 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_omit_file/Makefile: -------------------------------------------------------------------------------- 1 | #include ../../../Makefile.config 2 | 3 | #OP = $(CLANG_PASS) -emit-llvm -O0 -x cuda --cuda-gpu-arch=sm_60 -g 4 | OP = -O0 -x cu -arch=sm_70 -g 5 | 6 | all: 7 | nvcc $(OP) -c dot_product.cu 8 | nvcc $(OP) -c main.cu 9 | nvcc -o main dot_product.o main.o 10 | 11 | clean: 12 | rm -rf *.o main __pycache__ *_copy.* main_fpc fpchecker_conf.json 13 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_omit_file/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/tracing_tool/dynamic/test_omit_file/__init__.py -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_omit_file/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(double a, double b, double *res); 4 | 5 | __global__ void dot_prod(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_omit_file/fpchecker_conf.json.orig: -------------------------------------------------------------------------------- 1 | { 2 | "--skip_files": ["unwanted1.cpp", "unwanted2.cu", "dot_product_copy.cu"], 3 | "--restart_command": 1 4 | } 5 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_one_dir/Makefile: -------------------------------------------------------------------------------- 1 | #include ../../../Makefile.config 2 | 3 | #OP = $(CLANG_PASS) -emit-llvm -O0 -x cuda --cuda-gpu-arch=sm_60 -g 4 | OP = -O0 -x cu -arch=sm_70 -g 5 | 6 | all: 7 | nvcc $(OP) -c src/dot_product.cu 8 | nvcc $(OP) -c src/main.cu 9 | nvcc -o main dot_product.o main.o 10 | 11 | clean: 12 | rm -rf *.o main __pycache__ src/*_copy.* main_fpc 13 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_one_dir/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/tracing_tool/dynamic/test_one_dir/__init__.py -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_one_dir/src/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(double a, double b, double *res); 4 | 5 | __global__ void dot_prod(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_parser_comments/Makefile: -------------------------------------------------------------------------------- 1 | #include ../../../Makefile.config 2 | 3 | #OP = $(CLANG_PASS) -emit-llvm -O0 -x cuda --cuda-gpu-arch=sm_60 -g 4 | OP = -O0 -x cu -arch=sm_70 -g 5 | 6 | all: 7 | nvcc $(OP) -c dot_product.cu 8 | nvcc $(OP) -c main.cu 9 | nvcc -o main dot_product.o main.o 10 | 11 | clean: 12 | rm -rf *.o main __pycache__ *_copy.* main_fpc 13 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_parser_comments/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/tracing_tool/dynamic/test_parser_comments/__init__.py -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_parser_comments/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(double a, double b, double *res); 4 | 5 | __global__ void dot_prod(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_recursive_make/Makefile: -------------------------------------------------------------------------------- 1 | #include ../../../Makefile.config 2 | 3 | all: 4 | cd src && $(MAKE) 5 | 6 | clean: 7 | cd src && $(MAKE) clean 8 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_recursive_make/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/tracing_tool/dynamic/test_recursive_make/__init__.py -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_recursive_make/src/Makefile: -------------------------------------------------------------------------------- 1 | #include ../../../Makefile.config 2 | 3 | #OP = $(CLANG_PASS) -emit-llvm -O0 -x cuda --cuda-gpu-arch=sm_60 -g 4 | OP = -O0 -x cu -arch=sm_70 -g 5 | 6 | all: 7 | nvcc $(OP) -c dot_product.cu 8 | nvcc $(OP) -c main.cu 9 | nvcc -o main dot_product.o main.o 10 | 11 | clean: 12 | rm -rf *.o main __pycache__ *_copy.* main_fpc 13 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_recursive_make/src/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(double a, double b, double *res); 4 | 5 | __global__ void dot_prod(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_recursive_make_3_levels/Makefile: -------------------------------------------------------------------------------- 1 | #include ../../../Makefile.config 2 | 3 | all: 4 | cd src && $(MAKE) 5 | 6 | clean: 7 | cd src && $(MAKE) clean 8 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_recursive_make_3_levels/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/tracing_tool/dynamic/test_recursive_make_3_levels/__init__.py -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_recursive_make_3_levels/src/Makefile: -------------------------------------------------------------------------------- 1 | #include ../../../Makefile.config 2 | 3 | all: 4 | cd dir && $(MAKE) 5 | 6 | clean: 7 | cd dir && $(MAKE) clean 8 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_recursive_make_3_levels/src/dir/Makefile: -------------------------------------------------------------------------------- 1 | #include ../../../Makefile.config 2 | 3 | #OP = $(CLANG_PASS) -emit-llvm -O0 -x cuda --cuda-gpu-arch=sm_60 -g 4 | OP = -O0 -x cu -arch=sm_70 -g 5 | 6 | all: 7 | nvcc $(OP) -c dot_product.cu 8 | nvcc $(OP) -c main.cu 9 | nvcc -o main dot_product.o main.o 10 | 11 | clean: 12 | rm -rf *.o main __pycache__ *_copy.* main_fpc 13 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_recursive_make_3_levels/src/dir/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(double a, double b, double *res); 4 | 5 | __global__ void dot_prod(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_replay_single_command/Makefile: -------------------------------------------------------------------------------- 1 | #include ../../../Makefile.config 2 | 3 | #OP = $(CLANG_PASS) -emit-llvm -O0 -x cuda --cuda-gpu-arch=sm_60 -g 4 | OP = -O0 -x cu -arch=sm_70 -g 5 | 6 | all: 7 | nvcc $(OP) -c dot_product.cu 8 | nvcc $(OP) -c main.cu 9 | nvcc -o main dot_product.o main.o 10 | 11 | clean: 12 | rm -rf *.o main __pycache__ *_copy.* main_fpc 13 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_replay_single_command/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/tracing_tool/dynamic/test_replay_single_command/__init__.py -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_replay_single_command/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(double a, double b, double *res); 4 | 5 | __global__ void dot_prod(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_report_failed_commands/Makefile: -------------------------------------------------------------------------------- 1 | #include ../../../Makefile.config 2 | 3 | #OP = $(CLANG_PASS) -emit-llvm -O0 -x cuda --cuda-gpu-arch=sm_60 -g 4 | OP = -O0 -x cu -arch=sm_70 -g 5 | 6 | all: 7 | nvcc $(OP) -c dot_product.cu 8 | nvcc $(OP) -c compute.cu 9 | nvcc $(OP) -c main.cu 10 | nvcc -o main dot_product.o compute.o main.o 11 | 12 | clean: 13 | rm -rf *.o main __pycache__ *_copy.* main_fpc fpchecker_conf.json 14 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_report_failed_commands/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/tracing_tool/dynamic/test_report_failed_commands/__init__.py -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_report_failed_commands/compute.cu: -------------------------------------------------------------------------------- 1 | 2 | #include "compute.h" 3 | 4 | #ifdef __NVCC__ 5 | void compute() { 6 | return; 7 | } 8 | #else // clang 9 | __host__ __device__ void compute() {} 10 | __device__ void compute() {} 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_report_failed_commands/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ifdef __NVCC__ 4 | void compute(); 5 | #else // clang 6 | __host__ __device__ void compute(); 7 | __device__ void compute(); 8 | #endif 9 | 10 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_report_failed_commands/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(double a, double b, double *res); 4 | 5 | __global__ void dot_prod(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_rollback/Makefile: -------------------------------------------------------------------------------- 1 | #include ../../../Makefile.config 2 | 3 | #OP = $(CLANG_PASS) -emit-llvm -O0 -x cuda --cuda-gpu-arch=sm_60 -g 4 | OP = -O0 -x cu -arch=sm_70 -g 5 | 6 | all: 7 | nvcc $(OP) -c dot_product.cu 8 | nvcc $(OP) -c compute.cu 9 | nvcc $(OP) -c main.cu 10 | nvcc -o main dot_product.o compute.o main.o 11 | 12 | clean: 13 | rm -rf *.o main __pycache__ *_copy.* main_fpc fpchecker_conf.json 14 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_rollback/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/FPChecker/e665ef0f050316f6bc4dfc64c1f17355403e771b/tests/tracing_tool/dynamic/test_rollback/__init__.py -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_rollback/compute.cu: -------------------------------------------------------------------------------- 1 | 2 | #include "compute.h" 3 | 4 | #ifdef __NVCC__ 5 | void compute() { 6 | return; 7 | } 8 | #else // clang 9 | __host__ __device__ void compute() {} 10 | __device__ void compute() {} 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_rollback/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ifdef __NVCC__ 4 | void compute(); 5 | #else // clang 6 | __host__ __device__ void compute(); 7 | __device__ void compute(); 8 | #endif 9 | 10 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_rollback/dot_product.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | __device__ void mul(double a, double b, double *res); 4 | 5 | __global__ void dot_prod(double *x, double *y, int size); 6 | -------------------------------------------------------------------------------- /tracing_tool/colors.py: -------------------------------------------------------------------------------- 1 | def prGreen(skk): 2 | print("\033[92m{}\033[00m" .format(skk)) 3 | 4 | def prCyan(skk): 5 | print("\033[96m{}\033[00m" .format(skk)) 6 | 7 | def prRed(skk): 8 | print("\033[91m{}\033[00m" .format(skk)) 9 | 10 | 11 | -------------------------------------------------------------------------------- /tracing_tool/fpchecker: -------------------------------------------------------------------------------- 1 | /usr/workspace/wsa/laguna/fpchecker/FPChecker/tracing_tool/fpchecker.py --------------------------------------------------------------------------------