├── tests ├── tracing_tool │ ├── __init__.py │ └── dynamic │ │ ├── __init__.py │ │ ├── test_chdir │ │ ├── __init__.py │ │ ├── src │ │ │ └── dot_product.h │ │ └── Makefile │ │ ├── test_flat_make │ │ ├── __init__.py │ │ ├── dot_product.h │ │ └── Makefile │ │ ├── test_fortran │ │ ├── __init__.py │ │ ├── compute.h │ │ ├── compute.f95 │ │ ├── Makefile │ │ └── main.c │ │ ├── test_mkdir │ │ ├── __init__.py │ │ └── src │ │ │ └── dot_product.h │ │ ├── test_multidir │ │ ├── __init__.py │ │ ├── Makefile │ │ └── src │ │ │ └── dir1 │ │ │ └── dir2 │ │ │ └── dot_product.h │ │ ├── test_omit_file │ │ ├── __init__.py │ │ ├── fpchecker_conf.json.orig │ │ ├── dot_product.h │ │ └── Makefile │ │ ├── test_one_dir │ │ ├── __init__.py │ │ ├── src │ │ │ └── dot_product.h │ │ └── Makefile │ │ ├── test_rollback │ │ ├── __init__.py │ │ ├── dot_product.h │ │ ├── compute.h │ │ ├── compute.cu │ │ └── Makefile │ │ ├── test_class_members │ │ ├── __init__.py │ │ ├── circle.h │ │ ├── compute.h │ │ └── Makefile │ │ ├── test_cmake_cuda │ │ ├── __init__.py │ │ ├── CMakeLists.txt │ │ └── src │ │ │ └── compute.h │ │ ├── test_cmake_multidir │ │ ├── __init__.py │ │ ├── src │ │ │ ├── util │ │ │ │ ├── util.h │ │ │ │ ├── util.cpp │ │ │ │ └── CMakeLists.txt │ │ │ ├── core │ │ │ │ ├── server.h │ │ │ │ ├── server.cpp │ │ │ │ └── CMakeLists.txt │ │ │ ├── main.cpp │ │ │ └── CMakeLists.txt │ │ └── CMakeLists.txt │ │ ├── test_fortran_cmake │ │ ├── __init__.py │ │ ├── src │ │ │ ├── compute │ │ │ │ ├── compute.h │ │ │ │ ├── compute.f95 │ │ │ │ └── CMakeLists.txt │ │ │ ├── main.c │ │ │ └── CMakeLists.txt │ │ └── CMakeLists.txt │ │ ├── test_fortran_xl │ │ ├── __init__.py │ │ ├── compute.h │ │ ├── compute.f95 │ │ ├── Makefile │ │ └── main.c │ │ ├── test_lvalue_error │ │ ├── __init__.py │ │ ├── Makefile │ │ ├── test.cpp │ │ └── test_copy.cpp │ │ ├── test_mpi_and_nvcc │ │ ├── __init__.py │ │ ├── dot_product.h │ │ └── Makefile │ │ ├── test_mpicc_compiler │ │ ├── __init__.py │ │ └── src │ │ │ ├── cuda_launch.h │ │ │ ├── mpi_stuff.h │ │ │ ├── dot_product.h │ │ │ ├── mpi_stuff.cpp │ │ │ └── main.cpp │ │ ├── test_nvcc_flags │ │ ├── __init__.py │ │ └── src │ │ │ └── dot_product.h │ │ ├── test_nvcc_parser │ │ ├── __init__.py │ │ ├── include │ │ │ └── lib.h │ │ └── Makefile │ │ ├── test_recursive_make │ │ ├── __init__.py │ │ ├── Makefile │ │ └── src │ │ │ ├── dot_product.h │ │ │ └── Makefile │ │ ├── test_assign_to_reference │ │ ├── __init__.py │ │ ├── dot_product.h │ │ └── Makefile │ │ ├── test_cmake_ninja_cuda │ │ ├── __init__.py │ │ ├── CMakeLists.txt │ │ └── src │ │ │ └── compute.h │ │ ├── test_diff_object_names │ │ ├── __init__.py │ │ ├── src │ │ │ └── dot_product.h │ │ └── Makefile │ │ ├── test_expression_parser │ │ └── __init__.py │ │ ├── test_parser_comments │ │ ├── __init__.py │ │ ├── dot_product.h │ │ └── Makefile │ │ ├── test_fortran_cmake_openmp │ │ ├── __init__.py │ │ ├── src │ │ │ ├── compute │ │ │ │ ├── compute.h │ │ │ │ ├── CMakeLists.txt │ │ │ │ └── compute.f95 │ │ │ ├── main.c │ │ │ └── CMakeLists.txt │ │ └── CMakeLists.txt │ │ ├── test_recursive_make_3_levels │ │ ├── __init__.py │ │ ├── Makefile │ │ └── src │ │ │ ├── Makefile │ │ │ └── dir │ │ │ ├── dot_product.h │ │ │ └── Makefile │ │ ├── test_replay_single_command │ │ ├── __init__.py │ │ ├── dot_product.h │ │ └── Makefile │ │ └── test_report_failed_commands │ │ ├── __init__.py │ │ ├── dot_product.h │ │ ├── compute.h │ │ ├── compute.cu │ │ └── Makefile ├── cpu_checking │ ├── dynamic │ │ ├── __init__.py │ │ ├── test_c_and_cpp │ │ │ ├── __init__.py │ │ │ ├── compute.h │ │ │ ├── compute_2.h │ │ │ ├── compute_2.c │ │ │ ├── Makefile │ │ │ ├── compute.cpp │ │ │ └── main.cpp │ │ ├── test_fp32_fma │ │ │ ├── __init__.py │ │ │ └── Makefile │ │ ├── test_fp32_nan │ │ │ ├── __init__.py │ │ │ ├── compute.h │ │ │ ├── Makefile │ │ │ ├── compute.cpp │ │ │ └── main.cpp │ │ ├── test_fp64_fma │ │ │ ├── __init__.py │ │ │ └── Makefile │ │ ├── test_fp64_nan │ │ │ ├── __init__.py │ │ │ ├── compute.h │ │ │ ├── compute.cpp │ │ │ ├── main.cpp │ │ │ └── Makefile │ │ ├── test_mpi_run │ │ │ ├── __init__.py │ │ │ ├── compute.h │ │ │ ├── Makefile │ │ │ └── compute.cpp │ │ ├── test_openmp │ │ │ ├── __init__.py │ │ │ ├── compute.h │ │ │ ├── get_omp_lib_path.sh │ │ │ ├── Makefile │ │ │ └── main.cpp │ │ ├── test_cmake_multidir │ │ │ ├── __init__.py │ │ │ ├── src │ │ │ │ ├── util │ │ │ │ │ ├── util.h │ │ │ │ │ ├── util.cpp │ │ │ │ │ └── CMakeLists.txt │ │ │ │ ├── core │ │ │ │ │ ├── server.h │ │ │ │ │ ├── server.cpp │ │ │ │ │ └── CMakeLists.txt │ │ │ │ ├── main.cpp │ │ │ │ └── CMakeLists.txt │ │ │ └── CMakeLists.txt │ │ ├── test_fast_checking │ │ │ ├── __init__.py │ │ │ ├── compute.h │ │ │ ├── Makefile │ │ │ ├── Makefile_fast │ │ │ ├── compute.cpp │ │ │ └── main.cpp │ │ ├── test_fp32_subnormal │ │ │ ├── __init__.py │ │ │ ├── compute.h │ │ │ ├── Makefile │ │ │ ├── compute.cpp │ │ │ └── main.cpp │ │ ├── test_fp64_subnormal │ │ │ ├── __init__.py │ │ │ ├── compute.h │ │ │ ├── Makefile │ │ │ ├── compute.cpp │ │ │ └── main.cpp │ │ ├── test_long_filename │ │ │ ├── __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 │ │ │ ├── Makefile │ │ │ └── main.cpp │ │ ├── test_long_paths │ │ │ ├── __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 │ │ │ ├── Makefile │ │ │ └── main.cpp │ │ ├── test_multi_files │ │ │ ├── __init__.py │ │ │ ├── main.cpp │ │ │ ├── Makefile │ │ │ └── header.h │ │ ├── test_annotations_simple │ │ │ ├── __init__.py │ │ │ ├── Makefile_0 │ │ │ ├── Makefile_1 │ │ │ ├── Makefile_3 │ │ │ ├── Makefile_2 │ │ │ ├── Makefile_4 │ │ │ ├── Makefile_5 │ │ │ └── compute.h │ │ ├── test_clang_interceptor │ │ │ ├── __init__.py │ │ │ ├── compute.h │ │ │ ├── build.sh │ │ │ ├── example │ │ │ │ ├── test_exec │ │ │ │ └── Makefile │ │ │ ├── Makefile │ │ │ ├── compute.cpp │ │ │ └── main.cpp │ │ ├── test_fp32_cancellation │ │ │ ├── __init__.py │ │ │ ├── compute.h │ │ │ ├── Makefile │ │ │ └── compute.cpp │ │ ├── test_fp32_comparison │ │ │ ├── __init__.py │ │ │ ├── compute.h │ │ │ ├── Makefile │ │ │ └── main.cpp │ │ ├── test_fp32_division_zero │ │ │ ├── __init__.py │ │ │ ├── compute.h │ │ │ ├── Makefile │ │ │ ├── compute.cpp │ │ │ └── main.cpp │ │ ├── test_fp32_infinity_neg │ │ │ ├── __init__.py │ │ │ ├── compute.h │ │ │ ├── Makefile │ │ │ ├── compute.cpp │ │ │ └── main.cpp │ │ ├── test_fp32_infinity_pos │ │ │ ├── __init__.py │ │ │ ├── compute.h │ │ │ ├── Makefile │ │ │ ├── compute.cpp │ │ │ └── main.cpp │ │ ├── test_fp64_cancellation │ │ │ ├── __init__.py │ │ │ ├── compute.h │ │ │ ├── Makefile │ │ │ └── compute.cpp │ │ ├── test_fp64_comparison │ │ │ ├── __init__.py │ │ │ ├── compute.h │ │ │ ├── Makefile │ │ │ └── main.cpp │ │ ├── test_fp64_division_zero │ │ │ ├── __init__.py │ │ │ ├── compute.h │ │ │ ├── Makefile │ │ │ ├── compute.cpp │ │ │ └── main.cpp │ │ ├── test_fp64_infinity_neg │ │ │ ├── __init__.py │ │ │ ├── compute.h │ │ │ ├── Makefile │ │ │ ├── compute.cpp │ │ │ └── main.cpp │ │ ├── test_fp64_infinity_pos │ │ │ ├── __init__.py │ │ │ ├── compute.h │ │ │ ├── Makefile │ │ │ ├── compute.cpp │ │ │ └── main.cpp │ │ ├── test_mpi_interceptor │ │ │ ├── __init__.py │ │ │ ├── compute.h │ │ │ ├── compute.cpp │ │ │ └── Makefile │ │ ├── test_mpi_with_strings │ │ │ ├── __init__.py │ │ │ ├── compute.h │ │ │ ├── Makefile │ │ │ └── compute.cpp │ │ ├── test_str_comparisons │ │ │ ├── __init__.py │ │ │ └── Makefile │ │ ├── test_conditional_operations │ │ │ ├── __init__.py │ │ │ ├── compute.h │ │ │ ├── Makefile.2 │ │ │ ├── Makefile.1 │ │ │ ├── compute.cpp │ │ │ └── main.cpp │ │ ├── test_exponent_usage_basic │ │ │ ├── __init__.py │ │ │ ├── compute.h │ │ │ ├── compute.cpp │ │ │ ├── Makefile │ │ │ └── main.cpp │ │ ├── test_fp32_exp_usage_traces │ │ │ ├── __init__.py │ │ │ ├── compute.h │ │ │ ├── compute.cpp │ │ │ └── Makefile │ │ ├── test_fp32_latent_infinity_neg │ │ │ ├── __init__.py │ │ │ ├── compute.h │ │ │ ├── compute.cpp │ │ │ ├── Makefile │ │ │ └── main.cpp │ │ ├── test_fp32_latent_infinity_pos │ │ │ ├── __init__.py │ │ │ ├── compute.h │ │ │ ├── compute.cpp │ │ │ └── Makefile │ │ ├── test_fp32_latent_subnormal │ │ │ ├── __init__.py │ │ │ ├── compute.h │ │ │ ├── Makefile │ │ │ ├── compute.cpp │ │ │ └── main.cpp │ │ ├── test_fp64_exp_usage_traces │ │ │ ├── __init__.py │ │ │ ├── compute.h │ │ │ ├── compute.cpp │ │ │ └── Makefile │ │ ├── test_fp64_latent_infinity_neg │ │ │ ├── __init__.py │ │ │ ├── compute.h │ │ │ ├── Makefile │ │ │ └── compute.cpp │ │ ├── test_fp64_latent_infinity_pos │ │ │ ├── __init__.py │ │ │ ├── compute.h │ │ │ ├── Makefile │ │ │ └── compute.cpp │ │ ├── test_fp64_latent_subnormal │ │ │ ├── __init__.py │ │ │ ├── compute.h │ │ │ ├── Makefile │ │ │ └── compute.cpp │ │ ├── test_main_instrumentation │ │ │ ├── __init__.py │ │ │ ├── main_4.c │ │ │ ├── main_6.c │ │ │ ├── main_1.cpp │ │ │ ├── main_3.cpp │ │ │ ├── main_5.c │ │ │ ├── main_2.cpp │ │ │ └── main_7.c │ │ ├── test_string_compile_param │ │ │ ├── __init__.py │ │ │ ├── compute.h │ │ │ ├── Makefile │ │ │ └── compute.cpp │ │ ├── test_traps_with_env_variables │ │ │ ├── __init__.py │ │ │ ├── compute.h │ │ │ ├── Makefile │ │ │ └── compute.cpp │ │ ├── test_fp32_exp_usage_for_events │ │ │ ├── __init__.py │ │ │ └── Makefile │ │ └── test_fp64_exp_usage_for_events │ │ │ ├── __init__.py │ │ │ └── Makefile │ ├── reports │ │ ├── __init__.py │ │ ├── test_simple_report │ │ │ ├── __init__.py │ │ │ └── Makefile │ │ ├── test_fp32_exponent_usage │ │ │ ├── __init__.py │ │ │ └── Makefile │ │ ├── test_fp64_exponent_usage │ │ │ ├── __init__.py │ │ │ └── Makefile │ │ └── test_traces_not_found │ │ │ ├── __init__.py │ │ │ └── Makefile │ └── static │ │ ├── test_warnings │ │ ├── __init__.py │ │ ├── compute.h │ │ ├── compute.cpp │ │ └── main.cpp │ │ ├── test_build_mpi │ │ ├── compute.h │ │ ├── main.cpp │ │ ├── Makefile │ │ └── compute.cpp │ │ ├── test_full_report_generation │ │ ├── src │ │ │ ├── compute.h │ │ │ └── compute.cpp │ │ └── main.cpp │ │ ├── test_generate_report │ │ └── test.cpp │ │ ├── test_query_traces │ │ └── test.cpp │ │ ├── test_show_text_report │ │ └── test.cpp │ │ ├── test_recover_original_command │ │ ├── main.cpp │ │ ├── header.h │ │ └── Makefile │ │ ├── test_basic_block_annotations │ │ ├── Makefile_0 │ │ ├── Makefile_1 │ │ ├── Makefile_2 │ │ ├── Makefile_3 │ │ └── compute.h │ │ └── test_function_annotations │ │ ├── Makefile_0 │ │ ├── Makefile_1 │ │ ├── Makefile_4 │ │ ├── Makefile_2 │ │ ├── Makefile_3 │ │ └── compute.h ├── parser │ ├── dynamic │ │ ├── test_intercept_make │ │ │ ├── __init__.py │ │ │ ├── Makefile │ │ │ └── src │ │ │ │ ├── Makefile │ │ │ │ └── dir │ │ │ │ ├── dot_product.h │ │ │ │ └── Makefile │ │ ├── test_fp64_underflow_found │ │ │ ├── compute.h │ │ │ ├── dot_product.h │ │ │ └── Makefile │ │ ├── test_fp64_nan_found │ │ │ ├── dot_product.h │ │ │ └── Makefile │ │ ├── test_fp64_underflow_found_dont_abort │ │ │ ├── compute.h │ │ │ ├── dot_product.h │ │ │ └── Makefile │ │ ├── test_fp64_overflow_found │ │ │ ├── dot_product.h │ │ │ ├── Makefile.1 │ │ │ └── Makefile.2 │ │ ├── test_fp64_almost_underflow_found │ │ │ ├── dot_product.h │ │ │ ├── Makefile.1 │ │ │ └── Makefile.2 │ │ ├── test_fp64_nan_found_dont_abort │ │ │ ├── dot_product.h │ │ │ └── Makefile │ │ ├── test_fp64_overflow_found_dont_abort │ │ │ ├── dot_product.h │ │ │ └── Makefile │ │ ├── test_fp64_almost_overflow_found_dont_abort │ │ │ ├── dot_product.h │ │ │ ├── Makefile.1 │ │ │ └── Makefile.2 │ │ └── test_fp64_almost_underflow_found_dont_abort │ │ │ ├── dot_product.h │ │ │ ├── Makefile.2 │ │ │ └── Makefile.1 │ └── static │ │ ├── test_compile_derived_types │ │ ├── .fpc_log.txt │ │ ├── simple.hpp │ │ ├── Makefile │ │ ├── simple.cu │ │ └── simple_inst.cu │ │ ├── test_instrument_macro │ │ └── config.ini │ │ ├── test_instrument_multiline_macro │ │ └── config.ini │ │ ├── test_tokenize_simple │ │ └── simple.cu │ │ ├── test_tokenize_chars │ │ └── simple.cu │ │ ├── test_instrument_comments │ │ └── newFile.cpp │ │ ├── test_deprocess_empty │ │ └── newFile.cpp │ │ ├── test_match_device_host_spaces │ │ └── dot_product.h │ │ ├── test_tokenize_strings │ │ └── simple.cu │ │ ├── test_instrument_templates │ │ ├── header.hpp │ │ ├── Makefile │ │ └── compute.cu │ │ └── test_instrument_lambda │ │ ├── Makefile │ │ └── compute.cu ├── llvm │ ├── dynamic │ │ ├── _test_config.py │ │ ├── test_performance_errors_dont_abort │ │ │ ├── get_node_with_GPU.sh │ │ │ └── arr_sum.h │ │ ├── _test_config.py.in │ │ ├── test_fp64_underflow_found │ │ │ ├── compute.h │ │ │ ├── dot_product.h │ │ │ ├── Makefile │ │ │ └── compute.cu │ │ ├── test_fp32_nan_found │ │ │ ├── dot_product.h │ │ │ └── Makefile │ │ ├── test_fp32_overflow_found │ │ │ ├── dot_product.h │ │ │ └── Makefile │ │ ├── test_fp32_underflow_found │ │ │ ├── dot_product.h │ │ │ └── Makefile │ │ ├── test_fp64_nan_found │ │ │ ├── dot_product.h │ │ │ └── Makefile │ │ ├── test_ops_are_correct │ │ │ ├── dot_product.h │ │ │ ├── Makefile.2 │ │ │ ├── Makefile.3 │ │ │ ├── Makefile.4 │ │ │ └── Makefile.1 │ │ ├── test_print_at_main │ │ │ ├── dot_product.h │ │ │ └── Makefile │ │ ├── test_errors_dont_abort │ │ │ ├── dot_product.h │ │ │ ├── Makefile.0 │ │ │ ├── Makefile.2 │ │ │ ├── Makefile.3 │ │ │ └── Makefile.1 │ │ ├── test_fp64_overflow_found │ │ │ ├── dot_product.h │ │ │ ├── Makefile.2 │ │ │ └── Makefile.1 │ │ ├── test_warning_dont_abort │ │ │ └── dot_product.h │ │ ├── test_warnings_dont_abort │ │ │ ├── dot_product.h │ │ │ ├── Makefile.0 │ │ │ ├── Makefile.1 │ │ │ ├── Makefile.2 │ │ │ └── Makefile.3 │ │ ├── test_debug_info_is_correct │ │ │ ├── dot_product.h │ │ │ └── Makefile │ │ ├── test_fp32_almost_underflow_found │ │ │ ├── dot_product.h │ │ │ ├── Makefile.2 │ │ │ └── Makefile.1 │ │ ├── test_fp64_almost_underflow_found │ │ │ ├── dot_product.h │ │ │ ├── Makefile.2 │ │ │ └── Makefile.1 │ │ └── test_raja_examples │ │ │ ├── Makefile.errors_abort │ │ │ └── Makefile.errors_dont_abort │ └── static │ │ ├── test_simple_cuda │ │ ├── get_node_with_GPU.sh │ │ ├── compute.h │ │ ├── main.cu │ │ └── compute.cu │ │ ├── _test_config.py │ │ ├── _test_config.py.in │ │ ├── test_main_is_found │ │ ├── Makefile │ │ ├── get_llvm.sh │ │ └── compute.cu │ │ ├── test_device_func_found │ │ ├── Makefile │ │ └── compute.cu │ │ ├── test_global_func_found │ │ ├── Makefile │ │ └── compute.cu │ │ ├── test_find_inst_functions │ │ ├── Makefile │ │ └── compute.cu │ │ ├── test_number_fp_operations │ │ ├── Makefile │ │ └── compute.cu │ │ ├── test_correct_inst_functions_found │ │ ├── Makefile.1 │ │ ├── Makefile.2 │ │ ├── Makefile.3 │ │ ├── Makefile.0 │ │ └── compute.cu │ │ ├── test_global_array_instrumentation │ │ ├── Makefile.1 │ │ ├── Makefile.2 │ │ ├── Makefile.3 │ │ ├── Makefile.0 │ │ └── compute.cu │ │ └── test_global_warnings_instrumentation │ │ ├── Makefile.0 │ │ ├── Makefile.1 │ │ ├── Makefile.2 │ │ ├── Makefile.3 │ │ └── compute.cu ├── tests.sh ├── clang_plugin │ ├── dynamic │ │ ├── test_fp64_underflow_found │ │ │ ├── compute.h │ │ │ └── dot_product.h │ │ ├── test_fp64_flags │ │ │ └── dot_product.h │ │ ├── test_host_fp64_underflow_found │ │ │ ├── compute.h │ │ │ └── dot_product.h │ │ ├── test_fp32_overflow_found │ │ │ └── dot_product.h │ │ ├── test_fp64_nan_found │ │ │ └── dot_product.h │ │ ├── test_fp64_underflow_found_dont_abort │ │ │ ├── compute.h │ │ │ └── dot_product.h │ │ ├── test_host_fp32_overflow_found │ │ │ └── dot_product.h │ │ ├── test_host_fp64_nan_found │ │ │ └── dot_product.h │ │ ├── test_fp64_overflow_found │ │ │ └── dot_product.h │ │ ├── test_host_fp64_overflow_found │ │ │ └── dot_product.h │ │ ├── test_fp64_almost_underflow_found │ │ │ └── dot_product.h │ │ ├── test_fp64_nan_found_dont_abort │ │ │ └── dot_product.h │ │ ├── test_fp64_overflow_found_dont_abort │ │ │ └── dot_product.h │ │ ├── test_fp64_almost_overflow_found_dont_abort │ │ │ └── dot_product.h │ │ └── test_fp64_almost_underflow_found_dont_abort │ │ │ └── dot_product.h │ └── static │ │ ├── test_declarations │ │ ├── compute.cu.orig │ │ └── Makefile.0 │ │ ├── test_two_compilations │ │ ├── compute.cu.orig │ │ └── Makefile.0 │ │ ├── test_make_nested_dirs │ │ ├── src │ │ │ └── src │ │ │ │ ├── compute.cu.orig │ │ │ │ └── compute.cu │ │ └── Makefile.0 │ │ ├── test_comp_assignment │ │ ├── compute.cu.orig │ │ └── Makefile.0 │ │ ├── test_constant_expressions │ │ ├── compute.cu.orig │ │ └── Makefile.0 │ │ ├── test_multi_lines │ │ ├── compute.cu.orig │ │ └── Makefile.0 │ │ ├── test_integer_types │ │ ├── compute.cu.orig │ │ └── Makefile.0 │ │ ├── test_simple_lambda │ │ ├── compute.cpp.orig │ │ └── Makefile.0 │ │ ├── test_host_device │ │ └── Makefile.0 │ │ ├── test_already_instrumented │ │ └── Makefile.0 │ │ ├── test_static_initialization │ │ └── Makefile.0 │ │ └── test_pointer_expressions │ │ └── Makefile.0 └── tests_Makefile.in ├── lib ├── tutorial ├── common │ ├── .virtual_documents │ │ └── Untitled.ipynb │ └── io.hpp └── other_examples │ ├── benchmark │ ├── .fpc_logs │ │ ├── fpc_king01_77102.json │ │ ├── fpc_king01_77134.json │ │ ├── fpc_king01_77153.json │ │ ├── fpc_king01_77170.json │ │ └── fpc_king01_77197.json │ ├── lu_solve │ └── times.xlsx │ ├── fftw │ ├── fftw_test │ └── Makefile │ └── superlu │ ├── README.md │ └── Makefile ├── fpc_spack_repo └── repo.yaml ├── bin ├── fpc-debug ├── fpc-report ├── g++-fpc ├── nvcc-fpc ├── fpchecker ├── clang++-fpchecker ├── clang-fpchecker ├── mpiCC-fpchecker ├── mpic++-fpchecker ├── mpicc-fpchecker ├── mpicxx-fpchecker ├── mpig++-fpchecker ├── mpigcc-fpchecker ├── fpc-create-report ├── mpiclang++-fpchecker └── mpiclang-fpchecker ├── tracing_tool ├── fpchecker └── colors.py ├── figures └── logo_fpchecker.png ├── cpu_checking ├── report_templates │ ├── llnl_logo.png │ ├── icons │ │ └── logo_fpchecker.png │ ├── icons_3 │ │ └── logo_fpchecker.png │ └── icons_4 │ │ ├── logo_fpchecker.png │ │ └── infinity.svg ├── histograms │ └── report_templates │ │ ├── sample_plot.png │ │ └── icons │ │ └── logo_fpchecker.png ├── cc_frontend.sh ├── cc_mpi_frontend.sh ├── cxx_frontend.sh ├── cxx_mpi_frontend.sh ├── colors.py ├── fpc_logging.py └── exceptions.py ├── interception_tool ├── makefile ├── colors.py └── intercept.h.in ├── parser ├── test.ini ├── colors.py ├── fpc_logging.py └── exceptions.py ├── .travis.yml ├── .gitignore ├── limitations.md ├── plugin └── Makefile └── src └── Logging.h /tests/tracing_tool/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpu_checking/reports/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_c_and_cpp/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_fma/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_nan/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_fma/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_nan/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_mpi_run/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_openmp/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpu_checking/static/test_warnings/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/parser/dynamic/test_intercept_make/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_chdir/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_flat_make/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_fortran/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_mkdir/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_multidir/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_omit_file/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_one_dir/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_rollback/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib: -------------------------------------------------------------------------------- 1 | /usr/workspace/wsa/laguna/fpchecker/FPChecker/build -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_cmake_multidir/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fast_checking/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_subnormal/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_subnormal/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_long_filename/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_long_paths/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_multi_files/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpu_checking/reports/test_simple_report/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_class_members/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_cmake_cuda/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_cmake_multidir/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_fortran_cmake/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_fortran_xl/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_lvalue_error/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_mpi_and_nvcc/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_mpicc_compiler/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_nvcc_flags/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_nvcc_parser/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_recursive_make/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tutorial/common/.virtual_documents/Untitled.ipynb: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_annotations_simple/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_clang_interceptor/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_cancellation/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_comparison/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_division_zero/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_infinity_neg/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_infinity_pos/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_cancellation/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_comparison/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_division_zero/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_infinity_neg/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_infinity_pos/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_mpi_interceptor/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_mpi_with_strings/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_str_comparisons/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpu_checking/reports/test_fp32_exponent_usage/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpu_checking/reports/test_fp64_exponent_usage/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpu_checking/reports/test_traces_not_found/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_assign_to_reference/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_cmake_ninja_cuda/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_diff_object_names/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_expression_parser/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_parser_comments/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /fpc_spack_repo/repo.yaml: -------------------------------------------------------------------------------- 1 | repo: 2 | namespace: 'fpc_spack_repo' 3 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_conditional_operations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_exponent_usage_basic/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_exp_usage_traces/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_latent_infinity_neg/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_latent_infinity_pos/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_latent_subnormal/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_exp_usage_traces/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_latent_infinity_neg/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_latent_infinity_pos/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_latent_subnormal/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_main_instrumentation/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_string_compile_param/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_traps_with_env_variables/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_fortran_cmake_openmp/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_recursive_make_3_levels/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_replay_single_command/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_report_failed_commands/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_exp_usage_for_events/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_exp_usage_for_events/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /bin/fpc-debug: -------------------------------------------------------------------------------- 1 | /usr/workspace/wsa/laguna/fpchecker/FPChecker/parser/fpc-debug.py -------------------------------------------------------------------------------- /tutorial/other_examples/benchmark/.fpc_logs/fpc_king01_77102.json: -------------------------------------------------------------------------------- 1 | [ 2 | ] 3 | -------------------------------------------------------------------------------- /tutorial/other_examples/benchmark/.fpc_logs/fpc_king01_77134.json: -------------------------------------------------------------------------------- 1 | [ 2 | ] 3 | -------------------------------------------------------------------------------- /tutorial/other_examples/benchmark/.fpc_logs/fpc_king01_77153.json: -------------------------------------------------------------------------------- 1 | [ 2 | ] 3 | -------------------------------------------------------------------------------- /tutorial/other_examples/benchmark/.fpc_logs/fpc_king01_77170.json: -------------------------------------------------------------------------------- 1 | [ 2 | ] 3 | -------------------------------------------------------------------------------- /tutorial/other_examples/benchmark/.fpc_logs/fpc_king01_77197.json: -------------------------------------------------------------------------------- 1 | [ 2 | ] 3 | -------------------------------------------------------------------------------- /bin/fpc-report: -------------------------------------------------------------------------------- 1 | /usr/workspace/wsa/laguna/fpchecker/FPChecker/parser/fpc-debug.py -------------------------------------------------------------------------------- /bin/g++-fpc: -------------------------------------------------------------------------------- 1 | /usr/workspace/wsa/laguna/fpchecker/FPChecker/parser/g++_fpchecker.py -------------------------------------------------------------------------------- /bin/nvcc-fpc: -------------------------------------------------------------------------------- 1 | /usr/workspace/wsa/laguna/fpchecker/FPChecker/parser/nvcc_fpchecker.py -------------------------------------------------------------------------------- /tests/cpu_checking/static/test_build_mpi/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | void compute(double x); 4 | -------------------------------------------------------------------------------- /bin/fpchecker: -------------------------------------------------------------------------------- 1 | /usr/workspace/wsa/laguna/fpchecker/FPChecker/interception_tool/fpchecker.py -------------------------------------------------------------------------------- /tests/parser/static/test_compile_derived_types/.fpc_log.txt: -------------------------------------------------------------------------------- 1 | Instrumented: simple_inst.cu 2 | -------------------------------------------------------------------------------- /tracing_tool/fpchecker: -------------------------------------------------------------------------------- 1 | /usr/workspace/wsa/laguna/fpchecker/FPChecker/tracing_tool/fpchecker.py -------------------------------------------------------------------------------- /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/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/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/fpc-create-report: -------------------------------------------------------------------------------- 1 | /usr/workspace/wsa/laguna/fpchecker/FPChecker/cpu_checking/fpc_create_report.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 -------------------------------------------------------------------------------- /figures/logo_fpchecker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/llnl/FPChecker/HEAD/figures/logo_fpchecker.png -------------------------------------------------------------------------------- /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_fp64_nan/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | double compute(double *x, int n); 4 | 5 | -------------------------------------------------------------------------------- /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_openmp/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | double compute(double *x, int n); 4 | 5 | -------------------------------------------------------------------------------- /tests/cpu_checking/static/test_warnings/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | double compute(double *x, int n); 4 | 5 | -------------------------------------------------------------------------------- /tests/parser/static/test_instrument_macro/config.ini: -------------------------------------------------------------------------------- 1 | [omit] 2 | omit_lines = prog_1.cu:10-19 3 | 4 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_fortran/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | double compute_(double *x, double *y); 4 | -------------------------------------------------------------------------------- /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_fast_checking/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | double compute(double *x, int n); 4 | 5 | -------------------------------------------------------------------------------- /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_exp_usage_traces/compute.h: -------------------------------------------------------------------------------- 1 | float compute(float x, float y); 2 | 3 | -------------------------------------------------------------------------------- /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_long_filename/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | double compute(double *x, int n); 4 | 5 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_long_paths/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | double compute(double *x, int n); 4 | 5 | -------------------------------------------------------------------------------- /tests/cpu_checking/static/test_full_report_generation/src/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | void compute(double x); 4 | -------------------------------------------------------------------------------- /tests/llvm/dynamic/_test_config.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | # Config of test framework 4 | 5 | textWidth = "{:60}" 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/tracing_tool/dynamic/test_fortran_cmake_openmp/src/compute/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | void compute_(); 4 | -------------------------------------------------------------------------------- /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_fp32_cancellation/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | float compute(float *x, int n); 4 | 5 | -------------------------------------------------------------------------------- /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_infinity_neg/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | float compute(float *x, int n); 4 | 5 | -------------------------------------------------------------------------------- /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_fp64_cancellation/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | double compute(double *x, int n); 4 | 5 | -------------------------------------------------------------------------------- /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_division_zero/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | double compute(double *x, int n); 4 | 5 | -------------------------------------------------------------------------------- /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_pos/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | double compute(double *x, int n); 4 | 5 | -------------------------------------------------------------------------------- /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_mpi_interceptor/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | double compute(double *x, int n); 4 | 5 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_mpi_with_strings/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | double compute(double *x, int n); 4 | 5 | -------------------------------------------------------------------------------- /tests/parser/static/test_instrument_multiline_macro/config.ini: -------------------------------------------------------------------------------- 1 | [omit] 2 | omit_lines = prog_1.cu:10-19 3 | 4 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_lvalue_error/Makefile: -------------------------------------------------------------------------------- 1 | 2 | 3 | all: 4 | nvcc -x cu -arch=sm_70 -c test.cpp 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_cmake_multidir/src/util/util.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | double compute_util(double x, double y); 4 | -------------------------------------------------------------------------------- /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_exponent_usage_basic/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | double compute(double *x, int n); 4 | 5 | -------------------------------------------------------------------------------- /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_pos/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | float compute(float *x, int n); 4 | 5 | -------------------------------------------------------------------------------- /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_fp64_exp_usage_traces/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | double compute(double x, double y); 4 | 5 | -------------------------------------------------------------------------------- /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_string_compile_param/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | double compute(double *x, int n); 4 | 5 | -------------------------------------------------------------------------------- /tests/llvm/static/_test_config.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | # Config of test framework 4 | 5 | textWidth = "{:60}" 6 | path = "." 7 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_cmake_multidir/src/util/util.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | double compute_util(double x, double y); 4 | -------------------------------------------------------------------------------- /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_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_pos/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | double compute(double *x, int n); 4 | 5 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_traps_with_env_variables/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | double compute(double *x, int n); 4 | 5 | -------------------------------------------------------------------------------- /tests/parser/static/test_tokenize_simple/simple.cu: -------------------------------------------------------------------------------- 1 | 2 | __device__ 3 | void compute(double *x) { 4 | x[0] = 0; 5 | } 6 | -------------------------------------------------------------------------------- /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_fortran_cmake/src/compute/compute.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | double compute_(double *x, double *y); 4 | -------------------------------------------------------------------------------- /tests/tracing_tool/dynamic/test_nvcc_parser/include/lib.h: -------------------------------------------------------------------------------- 1 | 2 | __device__ double foo(double x) { 3 | return x; 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/llvm/dynamic/test_performance_errors_dont_abort/get_node_with_GPU.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | 3 | bsub -G guests -Is bash 4 | -------------------------------------------------------------------------------- /tutorial/other_examples/fftw/fftw_test: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/llnl/FPChecker/HEAD/tutorial/other_examples/fftw/fftw_test -------------------------------------------------------------------------------- /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/parser/dynamic/test_intercept_make/Makefile: -------------------------------------------------------------------------------- 1 | 2 | all: 3 | cd src && $(MAKE) 4 | 5 | clean: 6 | cd src && $(MAKE) clean 7 | -------------------------------------------------------------------------------- /cpu_checking/report_templates/llnl_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/llnl/FPChecker/HEAD/cpu_checking/report_templates/llnl_logo.png -------------------------------------------------------------------------------- /tutorial/other_examples/benchmark/lu_solve: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/llnl/FPChecker/HEAD/tutorial/other_examples/benchmark/lu_solve -------------------------------------------------------------------------------- /tutorial/other_examples/benchmark/times.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/llnl/FPChecker/HEAD/tutorial/other_examples/benchmark/times.xlsx -------------------------------------------------------------------------------- /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/test.cpp: -------------------------------------------------------------------------------- 1 | void compute() { 2 | double x = 0; 3 | double y = 0; 4 | double x = 0; 5 | } 6 | -------------------------------------------------------------------------------- /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/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/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/static/_test_config.py.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | # Config of test framework 4 | 5 | textWidth = "{:60}" 6 | path = "@CMAKE_BINARY_DIR@/tests/static" 7 | -------------------------------------------------------------------------------- /cpu_checking/report_templates/icons/logo_fpchecker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/llnl/FPChecker/HEAD/cpu_checking/report_templates/icons/logo_fpchecker.png -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /cpu_checking/histograms/report_templates/sample_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/llnl/FPChecker/HEAD/cpu_checking/histograms/report_templates/sample_plot.png -------------------------------------------------------------------------------- /cpu_checking/report_templates/icons_3/logo_fpchecker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/llnl/FPChecker/HEAD/cpu_checking/report_templates/icons_3/logo_fpchecker.png -------------------------------------------------------------------------------- /cpu_checking/report_templates/icons_4/logo_fpchecker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/llnl/FPChecker/HEAD/cpu_checking/report_templates/icons_4/logo_fpchecker.png -------------------------------------------------------------------------------- /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/mpi_stuff.h: -------------------------------------------------------------------------------- 1 | 2 | //#include 3 | 4 | void initMPI(int *argc, char ***argv); 5 | void finalizeMPI(); 6 | -------------------------------------------------------------------------------- /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/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/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/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/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/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/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/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/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/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_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_multidir/Makefile: -------------------------------------------------------------------------------- 1 | #include ../../../Makefile.config 2 | 3 | all: 4 | cd src && $(MAKE) 5 | 6 | clean: 7 | cd src && $(MAKE) clean 8 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_clang_interceptor/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | 3 | clang++ -c main.cpp -O2 4 | clang++ -c compute.cpp -O2 5 | clang++ -o main compute.o main.o 6 | -------------------------------------------------------------------------------- /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/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/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 | -------------------------------------------------------------------------------- /cpu_checking/histograms/report_templates/icons/logo_fpchecker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/llnl/FPChecker/HEAD/cpu_checking/histograms/report_templates/icons/logo_fpchecker.png -------------------------------------------------------------------------------- /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/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/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/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/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/cpu_checking/dynamic/test_clang_interceptor/example/test_exec: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/llnl/FPChecker/HEAD/tests/cpu_checking/dynamic/test_clang_interceptor/example/test_exec -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp32_exp_usage_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/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/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_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_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_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/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_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/src/Makefile: -------------------------------------------------------------------------------- 1 | #include ../../../Makefile.config 2 | 3 | all: 4 | cd dir && $(MAKE) 5 | 6 | clean: 7 | cd dir && $(MAKE) clean 8 | -------------------------------------------------------------------------------- /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_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/cpu_checking/dynamic/test_fp64_exp_usage_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/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_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/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_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/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/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/compute.h: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | __device__ 5 | double power(double x); 6 | 7 | __global__ 8 | void compute(double x); 9 | -------------------------------------------------------------------------------- /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_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/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_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/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.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_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/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/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_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_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 | -------------------------------------------------------------------------------- /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_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_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_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/cpu_checking/dynamic/test_clang_interceptor/example/Makefile: -------------------------------------------------------------------------------- 1 | 2 | 3 | all: 4 | clang -o test_exec test_exec.c 5 | clang -shared -o libmy_exec_override.so -fPIC my_exec_override.c -ldl 6 | -------------------------------------------------------------------------------- /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_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/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_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_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_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/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/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_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_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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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_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_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/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/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/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_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/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_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_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_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_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_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_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/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 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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_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_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_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/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 | -------------------------------------------------------------------------------- /tutorial/other_examples/superlu/README.md: -------------------------------------------------------------------------------- 1 | ## SuperLU Example 2 | 3 | ### Compiling 4 | 5 | FPC_INSTRUMENT=1 make 6 | 7 | ### Running 8 | 9 | FPC_EXPONENT_USAGE=1 ./superlu_test matrix.csv 10 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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_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/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/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_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/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/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/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/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/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_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/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/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/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/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/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/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/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/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/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_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 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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_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/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/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_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_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/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/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_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_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/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_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/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_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/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/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/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/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/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/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_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/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/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/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/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/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 | // Latent overflow 8 | res = x[i] * -1.12345678e+36f; 9 | } 10 | return res; 11 | } 12 | -------------------------------------------------------------------------------- /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 | // Latent overflow 8 | res = x[i] * 1e+36f; 9 | } 10 | return res; 11 | } 12 | 13 | 14 | -------------------------------------------------------------------------------- /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_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_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/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_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 | -------------------------------------------------------------------------------- /.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 | .fpc_log.txt 19 | .vscode/ 20 | *.ipynb_checkpoints/ 21 | *.virtual_documents/* 22 | -------------------------------------------------------------------------------- /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/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 | res = x[i] * (1e-36f); 9 | } 10 | return res; 11 | } 12 | 13 | 14 | -------------------------------------------------------------------------------- /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_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_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/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/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_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/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_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_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_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_exponent_usage_basic/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_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_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_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_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_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_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_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_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_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/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/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/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/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/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_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_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_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_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/static/test_build_mpi/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/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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_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_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_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_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/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_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/cpu_checking/dynamic/test_annotations_simple/Makefile_0: -------------------------------------------------------------------------------- 1 | 2 | OP = -O2 3 | CXX = FPC_INSTRUMENT=1 FPC_ANNOTATED=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_fp32_exp_usage_traces/Makefile: -------------------------------------------------------------------------------- 1 | 2 | OP = -O0 -g 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_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_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 | // Latent overflow 9 | res = x[i] * -1e+300; 10 | } 11 | return res; 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /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 | // Latent overflow 9 | res = x[i] * 1e+300; 10 | } 11 | return res; 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /tests/cpu_checking/static/test_basic_block_annotations/Makefile_0: -------------------------------------------------------------------------------- 1 | 2 | OP = -O2 3 | CXX = FPC_INSTRUMENT=1 FPC_ANNOTATED=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/static/test_function_annotations/Makefile_0: -------------------------------------------------------------------------------- 1 | 2 | OP = -O2 3 | CXX = FPC_INSTRUMENT=1 FPC_ANNOTATED=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/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/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/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_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 | -------------------------------------------------------------------------------- /tutorial/common/io.hpp: -------------------------------------------------------------------------------- 1 | #ifndef IO_HPP 2 | #define IO_HPP 3 | 4 | #include 5 | #include 6 | 7 | std::vector> load_matrix_from_csv(const std::string &filename); 8 | void save_matrix_to_csv(const std::vector> &matrix, const std::string &filename); 9 | 10 | #endif // IO_HPP -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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_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/cpu_checking/dynamic/test_annotations_simple/Makefile_1: -------------------------------------------------------------------------------- 1 | 2 | OP = -O2 -DFUNC_1 3 | CXX = FPC_INSTRUMENT=1 FPC_ANNOTATED=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_annotations_simple/Makefile_3: -------------------------------------------------------------------------------- 1 | 2 | OP = -O2 -DFUNC_2 3 | CXX = FPC_INSTRUMENT=1 FPC_ANNOTATED=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_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_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_exp_usage_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_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_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/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_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_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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_annotations_simple/Makefile_2: -------------------------------------------------------------------------------- 1 | 2 | OP = -O2 -DBLOCK_1 3 | CXX = FPC_INSTRUMENT=1 FPC_ANNOTATED=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_annotations_simple/Makefile_4: -------------------------------------------------------------------------------- 1 | 2 | OP = -O2 -DBLOCK_2 3 | CXX = FPC_INSTRUMENT=1 FPC_ANNOTATED=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_annotations_simple/Makefile_5: -------------------------------------------------------------------------------- 1 | 2 | OP = -O2 -DBLOCK_3 3 | CXX = FPC_INSTRUMENT=1 FPC_ANNOTATED=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_exponent_usage_basic/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_fp32_exp_usage_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_exp_usage_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/static/test_function_annotations/Makefile_1: -------------------------------------------------------------------------------- 1 | 2 | OP = -O2 -DFUNC_1 3 | CXX = FPC_INSTRUMENT=1 FPC_ANNOTATED=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/static/test_function_annotations/Makefile_4: -------------------------------------------------------------------------------- 1 | 2 | OP = -O2 -DBLOCK_1 3 | CXX = FPC_INSTRUMENT=1 FPC_ANNOTATED=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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/cpu_checking/static/test_basic_block_annotations/Makefile_1: -------------------------------------------------------------------------------- 1 | 2 | OP = -O2 -DINSTRUMENT_1 3 | CXX = FPC_INSTRUMENT=1 FPC_ANNOTATED=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/static/test_basic_block_annotations/Makefile_2: -------------------------------------------------------------------------------- 1 | 2 | OP = -O2 -DINSTRUMENT_2 3 | CXX = FPC_INSTRUMENT=1 FPC_ANNOTATED=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/static/test_basic_block_annotations/Makefile_3: -------------------------------------------------------------------------------- 1 | 2 | OP = -O2 -DINSTRUMENT_3 3 | CXX = FPC_INSTRUMENT=1 FPC_ANNOTATED=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/static/test_function_annotations/Makefile_2: -------------------------------------------------------------------------------- 1 | 2 | OP = -O2 -DFUNC_1 -DBLOCK_1 3 | CXX = FPC_INSTRUMENT=1 FPC_ANNOTATED=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/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/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_fp32_fma/Makefile: -------------------------------------------------------------------------------- 1 | 2 | OP = -O0 -g 3 | CXX = FPC_INSTRUMENT=1 clang++-fpchecker 4 | 5 | all: 6 | $(CXX) -c main.cpp $(OP) 7 | $(CXX) -c compute.cpp $(OP) 8 | $(CXX) -c printing.cpp $(OP) 9 | $(CXX) -o main compute.o main.o printing.o -ldl 10 | 11 | clean: 12 | rm -rf *.o main __pycache__ .fpc_logs .fpc_log.txt 13 | -------------------------------------------------------------------------------- /tests/cpu_checking/dynamic/test_fp64_fma/Makefile: -------------------------------------------------------------------------------- 1 | 2 | OP = -O0 -g 3 | CXX = FPC_INSTRUMENT=1 clang++-fpchecker 4 | 5 | all: 6 | $(CXX) -c main.cpp $(OP) 7 | $(CXX) -c compute.cpp $(OP) 8 | $(CXX) -c printing.cpp $(OP) 9 | $(CXX) -o main compute.o main.o printing.o -ldl 10 | 11 | clean: 12 | rm -rf *.o main __pycache__ .fpc_logs .fpc_log.txt 13 | -------------------------------------------------------------------------------- /tests/cpu_checking/static/test_function_annotations/Makefile_3: -------------------------------------------------------------------------------- 1 | 2 | OP = -O2 -DFUNC_1 -DBLOCK_1 -DFUNC_2 3 | CXX = FPC_INSTRUMENT=1 FPC_ANNOTATED=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/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/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 | -------------------------------------------------------------------------------- /cpu_checking/report_templates/icons_4/infinity.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /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/reports/test_traces_not_found/Makefile: -------------------------------------------------------------------------------- 1 | 2 | OP = -O0 -g 3 | CXX = FPC_INSTRUMENT=1 clang++-fpchecker 4 | 5 | all: 6 | $(CXX) -c main.cpp $(OP) 7 | $(CXX) -c compute.cpp $(OP) 8 | $(CXX) -c printing.cpp $(OP) 9 | $(CXX) -o main compute.o main.o printing.o 10 | 11 | clean: 12 | rm -rf *.o main __pycache__ .fpc_logs .fpc_log.txt ./fpc-report 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 | -------------------------------------------------------------------------------- /tutorial/other_examples/fftw/Makefile: -------------------------------------------------------------------------------- 1 | 2 | CC=/Users/lagunaperalt1/projects/fpchecker/FPChecker/build/install/bin/clang-fpchecker 3 | FFTW_PATH=/tmp/tutorial/examples/fftw/fftw-3.3.10/fftw-install 4 | 5 | all: 6 | $(CC) -c fftw_test.c -I$(FFTW_PATH)/include 7 | $(CC) fftw_test.o -L$(FFTW_PATH)/lib -lfftw3 -lm -o fftw_test 8 | 9 | clean: 10 | rm -rf fftw_test 11 | -------------------------------------------------------------------------------- /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/reports/test_simple_report/Makefile: -------------------------------------------------------------------------------- 1 | 2 | OP = -O0 -g 3 | CXX = FPC_INSTRUMENT=1 clang++-fpchecker 4 | 5 | all: 6 | $(CXX) -c main.cpp $(OP) 7 | $(CXX) -c compute.cpp $(OP) 8 | $(CXX) -c printing.cpp $(OP) 9 | $(CXX) -o main compute.o main.o printing.o -ldl 10 | 11 | clean: 12 | rm -rf *.o main __pycache__ .fpc_logs .fpc_log.txt ./fpc-report 13 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/cpu_checking/reports/test_fp32_exponent_usage/Makefile: -------------------------------------------------------------------------------- 1 | 2 | OP = -O0 -g 3 | CXX = FPC_INSTRUMENT=1 clang++-fpchecker 4 | 5 | all: 6 | $(CXX) -c main.cpp $(OP) 7 | $(CXX) -c compute.cpp $(OP) 8 | $(CXX) -c printing.cpp $(OP) 9 | $(CXX) -o main compute.o main.o printing.o -ldl 10 | 11 | clean: 12 | rm -rf *.o main __pycache__ .fpc_logs .fpc_log.txt ./fpc-report 13 | -------------------------------------------------------------------------------- /tests/cpu_checking/reports/test_fp64_exponent_usage/Makefile: -------------------------------------------------------------------------------- 1 | 2 | OP = -O0 -g 3 | CXX = FPC_INSTRUMENT=1 clang++-fpchecker 4 | 5 | all: 6 | $(CXX) -c main.cpp $(OP) 7 | $(CXX) -c compute.cpp $(OP) 8 | $(CXX) -c printing.cpp $(OP) 9 | $(CXX) -o main compute.o main.o printing.o -ldl 10 | 11 | clean: 12 | rm -rf *.o main __pycache__ .fpc_logs .fpc_log.txt ./fpc-report 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/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/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_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_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/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_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/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/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/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_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/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/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/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_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_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_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/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/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_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/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_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_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_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/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/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 | -------------------------------------------------------------------------------- /tutorial/other_examples/superlu/Makefile: -------------------------------------------------------------------------------- 1 | 2 | NAME=superlu_test 3 | 4 | CXX=clang-fpchecker 5 | SU_PATH=/tmp/tutorial/examples/superlu/build/install 6 | OP=-Wno-deprecated-declarations -g 7 | 8 | all: 9 | $(CXX) -c $(NAME).c $(OP) -I$(SU_PATH)/include 10 | $(CXX) $(NAME).o -o $(NAME) -L$(SU_PATH)/lib -lsuperlu -lblas -llapack -lm 11 | 12 | clean: 13 | rm -rf *.o $(NAME) fpc-report .fpc_logs 14 | -------------------------------------------------------------------------------- /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_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/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_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/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/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_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/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_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/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/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/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/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.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_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_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_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/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_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_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/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/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/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/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/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_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_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/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/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/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/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/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/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_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_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_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/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/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/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/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_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/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/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/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/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_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/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/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_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/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/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_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/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/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/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/cpu_checking/dynamic/test_annotations_simple/compute.h: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | std::vector> matrix_multiply(const std::vector> &A, 5 | const std::vector> &B); 6 | 7 | std::vector> subtract_matrices(const std::vector> &A, 8 | const std::vector> &B); -------------------------------------------------------------------------------- /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/static/test_function_annotations/compute.h: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | std::vector> matrix_multiply(const std::vector> &A, 5 | const std::vector> &B); 6 | 7 | std::vector> subtract_matrices(const std::vector> &A, 8 | const std::vector> &B); -------------------------------------------------------------------------------- /tests/cpu_checking/static/test_basic_block_annotations/compute.h: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | std::vector> matrix_multiply(const std::vector> &A, 5 | const std::vector> &B); 6 | 7 | std::vector> subtract_matrices(const std::vector> &A, 8 | const std::vector> &B); -------------------------------------------------------------------------------- /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/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_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/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_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/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/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_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/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_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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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_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_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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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_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/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_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/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_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/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/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_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/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_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/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/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/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_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_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/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_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/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_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_exponent_usage_basic/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_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 | --------------------------------------------------------------------------------