├── LICENSE ├── README.md ├── Template └── template.F90 ├── Tests ├── acc_async_test.F90 ├── acc_async_test.c ├── acc_async_test.cpp ├── acc_async_test_all.F90 ├── acc_async_test_all.c ├── acc_async_test_all.cpp ├── acc_attach.c ├── acc_copyin.F90 ├── acc_copyin.c ├── acc_copyin.cpp ├── acc_copyin_async.F90 ├── acc_copyin_async.c ├── acc_copyin_async.cpp ├── acc_copyin_async_with_len.F90 ├── acc_copyin_with_len.F90 ├── acc_copyout.F90 ├── acc_copyout.c ├── acc_copyout.cpp ├── acc_copyout_async.F90 ├── acc_copyout_async.c ├── acc_copyout_async.cpp ├── acc_copyout_async_with_len.F90 ├── acc_copyout_finalize.F90 ├── acc_copyout_finalize.c ├── acc_copyout_finalize.cpp ├── acc_copyout_finalize_async.F90 ├── acc_copyout_finalize_async.c ├── acc_copyout_finalize_async.cpp ├── acc_copyout_finalize_async_with_len.F90 ├── acc_copyout_finalize_with_len.F90 ├── acc_copyout_with_len.F90 ├── acc_create.F90 ├── acc_create.c ├── acc_create.cpp ├── acc_create_async.F90 ├── acc_create_async.c ├── acc_create_async.cpp ├── acc_create_async_with_len.F90 ├── acc_create_with_len.F90 ├── acc_delete.F90 ├── acc_delete.c ├── acc_delete.cpp ├── acc_delete_async.F90 ├── acc_delete_async.c ├── acc_delete_async.cpp ├── acc_delete_async_with_len.F90 ├── acc_delete_finalize.F90 ├── acc_delete_finalize.c ├── acc_delete_finalize.cpp ├── acc_delete_finalize_async.F90 ├── acc_delete_finalize_async.c ├── acc_delete_finalize_async.cpp ├── acc_delete_finalize_async_with_len.F90 ├── acc_delete_finalize_with_len.F90 ├── acc_delete_with_len.F90 ├── acc_detach.c ├── acc_deviceptr.F90 ├── acc_deviceptr.c ├── acc_deviceptr.cpp ├── acc_free.F90 ├── acc_free.c ├── acc_free.cpp ├── acc_get_default_async.F90 ├── acc_get_default_async.c ├── acc_get_default_async.cpp ├── acc_get_device_num.F90 ├── acc_get_device_num.c ├── acc_get_device_num.cpp ├── acc_get_device_type.c ├── acc_get_device_type.cpp ├── acc_get_num_devices.F90 ├── acc_get_num_devices.c ├── acc_get_num_devices.cpp ├── acc_get_property.F90 ├── acc_get_property.c ├── acc_get_property.cpp ├── acc_get_property_string.F90 ├── acc_hostptr.F90 ├── acc_hostptr.c ├── acc_hostptr.cpp ├── acc_init.F90 ├── acc_init.c ├── acc_init.cpp ├── acc_init_device.c ├── acc_is_present.F90 ├── acc_is_present.c ├── acc_is_present.cpp ├── acc_is_present_with_len.F90 ├── acc_malloc.F90 ├── acc_malloc.c ├── acc_malloc.cpp ├── acc_map_data.F90 ├── acc_map_data.c ├── acc_map_data.cpp ├── acc_memcpy_d2d.F90 ├── acc_memcpy_d2d.c ├── acc_memcpy_d2d.cpp ├── acc_memcpy_device.c ├── acc_memcpy_device.cpp ├── acc_memcpy_from_device.c ├── acc_memcpy_from_device.cpp ├── acc_memcpy_from_device_async.c ├── acc_memcpy_from_device_async.cpp ├── acc_memcpy_to_device.c ├── acc_memcpy_to_device.cpp ├── acc_memcpy_to_device_async.c ├── acc_memcpy_to_device_async.cpp ├── acc_on_device.F90 ├── acc_on_device.c ├── acc_on_device.cpp ├── acc_set_default_async.F90 ├── acc_set_default_async.c ├── acc_set_default_async.cpp ├── acc_set_device_num.F90 ├── acc_set_device_num.c ├── acc_set_device_num.cpp ├── acc_set_device_type.F90 ├── acc_set_device_type.c ├── acc_set_device_type.cpp ├── acc_shutdown.F90 ├── acc_shutdown.c ├── acc_shutdown.cpp ├── acc_shutdown_device.c ├── acc_testsuite.Fh ├── acc_testsuite.h ├── acc_testsuite_declare.h ├── acc_unmap_data.F90 ├── acc_unmap_data.c ├── acc_unmap_data.cpp ├── acc_update_device.F90 ├── acc_update_device.c ├── acc_update_device.cpp ├── acc_update_device_async.F90 ├── acc_update_device_async.c ├── acc_update_device_async.cpp ├── acc_update_device_async_with_len.F90 ├── acc_update_device_with_len.F90 ├── acc_update_self.F90 ├── acc_update_self.c ├── acc_update_self.cpp ├── acc_update_self_async.F90 ├── acc_update_self_async.c ├── acc_update_self_async.cpp ├── acc_update_self_async_with_len.F90 ├── acc_update_self_with_len.F90 ├── acc_wait.F90 ├── acc_wait.c ├── acc_wait.cpp ├── acc_wait_all.F90 ├── acc_wait_all.c ├── acc_wait_all.cpp ├── acc_wait_all_async.F90 ├── acc_wait_all_async.c ├── acc_wait_all_async.cpp ├── acc_wait_any.c ├── acc_wait_any.cpp ├── acc_wait_async.F90 ├── acc_wait_async.c ├── acc_wait_async.cpp ├── atomic_bitand_equals.c ├── atomic_bitand_equals.cpp ├── atomic_bitor_equals.c ├── atomic_bitor_equals.cpp ├── atomic_bitxor_equals.c ├── atomic_bitxor_equals.cpp ├── atomic_capture_assign_expr_and_x.F90 ├── atomic_capture_assign_expr_divided_x.F90 ├── atomic_capture_assign_expr_eqv_x.F90 ├── atomic_capture_assign_expr_minus_x.F90 ├── atomic_capture_assign_expr_neqv_x.F90 ├── atomic_capture_assign_expr_or_x.F90 ├── atomic_capture_assign_expr_plus_x.F90 ├── atomic_capture_assign_expr_times_x.F90 ├── atomic_capture_assign_iand_expr_x.F90 ├── atomic_capture_assign_iand_x_expr.F90 ├── atomic_capture_assign_ior_expr_x.F90 ├── atomic_capture_assign_ior_x_expr.F90 ├── atomic_capture_assign_ixor_expr_x.F90 ├── atomic_capture_assign_ixor_x_expr.F90 ├── atomic_capture_assign_max_expr_list_x.F90 ├── atomic_capture_assign_max_expr_x.F90 ├── atomic_capture_assign_max_x_expr.F90 ├── atomic_capture_assign_max_x_expr_list.F90 ├── atomic_capture_assign_min_expr_list_x.F90 ├── atomic_capture_assign_min_expr_x.F90 ├── atomic_capture_assign_min_x_expr.F90 ├── atomic_capture_assign_min_x_expr_list.F90 ├── atomic_capture_assign_x_and_expr.F90 ├── atomic_capture_assign_x_divided_expr.F90 ├── atomic_capture_assign_x_eqv_expr.F90 ├── atomic_capture_assign_x_minus_expr.F90 ├── atomic_capture_assign_x_neqv_expr.F90 ├── atomic_capture_assign_x_or_expr.F90 ├── atomic_capture_assign_x_plus_expr.F90 ├── atomic_capture_assign_x_times_expr.F90 ├── atomic_capture_bitand_equals.c ├── atomic_capture_bitand_equals.cpp ├── atomic_capture_bitor_equals.c ├── atomic_capture_bitor_equals.cpp ├── atomic_capture_bitxor_equals.c ├── atomic_capture_bitxor_equals.cpp ├── atomic_capture_divided_equals.c ├── atomic_capture_divided_equals.cpp ├── atomic_capture_expr_and_x_assign.F90 ├── atomic_capture_expr_bitand_x.c ├── atomic_capture_expr_bitand_x.cpp ├── atomic_capture_expr_bitor_x.c ├── atomic_capture_expr_bitor_x.cpp ├── atomic_capture_expr_bitxor_x.c ├── atomic_capture_expr_bitxor_x.cpp ├── atomic_capture_expr_divided_x.c ├── atomic_capture_expr_divided_x.cpp ├── atomic_capture_expr_divided_x_assign.F90 ├── atomic_capture_expr_eqv_x_assign.F90 ├── atomic_capture_expr_lshift_x.c ├── atomic_capture_expr_lshift_x.cpp ├── atomic_capture_expr_minus_x.c ├── atomic_capture_expr_minus_x.cpp ├── atomic_capture_expr_minus_x_assign.F90 ├── atomic_capture_expr_multiply_x.c ├── atomic_capture_expr_multiply_x.cpp ├── atomic_capture_expr_neqv_x_assign.F90 ├── atomic_capture_expr_or_x_assign.F90 ├── atomic_capture_expr_plus_x.c ├── atomic_capture_expr_plus_x.cpp ├── atomic_capture_expr_plus_x_assign.F90 ├── atomic_capture_expr_rshift_x.c ├── atomic_capture_expr_rshift_x.cpp ├── atomic_capture_expr_times_x_assign.F90 ├── atomic_capture_iand_expr_x_assign.F90 ├── atomic_capture_iand_x_expr_assign.F90 ├── atomic_capture_ior_expr_x_assign.F90 ├── atomic_capture_ior_x_expr_assign.F90 ├── atomic_capture_ixor_expr_x_assign.F90 ├── atomic_capture_ixor_x_expr_assign.F90 ├── atomic_capture_lshift_equals.c ├── atomic_capture_lshift_equals.cpp ├── atomic_capture_max_expr_list_x_assign.F90 ├── atomic_capture_max_expr_x_assign.F90 ├── atomic_capture_max_x_expr_assign.F90 ├── atomic_capture_max_x_expr_list_assign.F90 ├── atomic_capture_min_expr_list_x_assign.F90 ├── atomic_capture_min_expr_x_assign.F90 ├── atomic_capture_min_x_expr_assign.F90 ├── atomic_capture_min_x_expr_list_assign.F90 ├── atomic_capture_minus_equals.c ├── atomic_capture_minus_equals.cpp ├── atomic_capture_multiply_equals.c ├── atomic_capture_multiply_equals.cpp ├── atomic_capture_plus_equals.c ├── atomic_capture_plus_equals.cpp ├── atomic_capture_postdecrement.c ├── atomic_capture_postdecrement.cpp ├── atomic_capture_postincrement.c ├── atomic_capture_postincrement.cpp ├── atomic_capture_predecrement.c ├── atomic_capture_predecrement.cpp ├── atomic_capture_preincrement.c ├── atomic_capture_preincrement.cpp ├── atomic_capture_rshift_equals.c ├── atomic_capture_rshift_equals.cpp ├── atomic_capture_x_and_expr_assign.F90 ├── atomic_capture_x_divided_expr_assign.F90 ├── atomic_capture_x_eqv_expr_assign.F90 ├── atomic_capture_x_minus_expr_assign.F90 ├── atomic_capture_x_neqv_expr_assign.F90 ├── atomic_capture_x_or_expr_assign.F90 ├── atomic_capture_x_plus_expr_assign.F90 ├── atomic_capture_x_times_expr_assign.F90 ├── atomic_divided_equals.c ├── atomic_divided_equals.cpp ├── atomic_expr_and_x.F90 ├── atomic_expr_and_x_end.F90 ├── atomic_expr_bitand_x.c ├── atomic_expr_bitand_x.cpp ├── atomic_expr_bitor_x.c ├── atomic_expr_bitor_x.cpp ├── atomic_expr_bitxor_x.c ├── atomic_expr_bitxor_x.cpp ├── atomic_expr_divided_x.F90 ├── atomic_expr_divided_x.c ├── atomic_expr_divided_x.cpp ├── atomic_expr_divided_x_end.F90 ├── atomic_expr_eqv_x.F90 ├── atomic_expr_eqv_x_end.F90 ├── atomic_expr_lshift_x.c ├── atomic_expr_lshift_x.cpp ├── atomic_expr_minus_x.F90 ├── atomic_expr_minus_x.c ├── atomic_expr_minus_x.cpp ├── atomic_expr_minus_x_end.F90 ├── atomic_expr_multiply_x.c ├── atomic_expr_multiply_x.cpp ├── atomic_expr_neqv_x.F90 ├── atomic_expr_neqv_x_end.F90 ├── atomic_expr_or_x.F90 ├── atomic_expr_or_x_end.F90 ├── atomic_expr_plus_x.F90 ├── atomic_expr_plus_x.c ├── atomic_expr_plus_x.cpp ├── atomic_expr_plus_x_end.F90 ├── atomic_expr_rshift_x.c ├── atomic_expr_rshift_x.cpp ├── atomic_expr_times_x.F90 ├── atomic_expr_times_x_end.F90 ├── atomic_iand_expr_x.F90 ├── atomic_iand_expr_x_end.F90 ├── atomic_iand_x_expr.F90 ├── atomic_iand_x_expr_end.F90 ├── atomic_ior_expr_x.F90 ├── atomic_ior_expr_x_end.F90 ├── atomic_ior_x_expr.F90 ├── atomic_ior_x_expr_end.F90 ├── atomic_ixor_expr_x.F90 ├── atomic_ixor_expr_x_end.F90 ├── atomic_ixor_x_expr.F90 ├── atomic_ixor_x_expr_end.F90 ├── atomic_lshift_equals.c ├── atomic_lshift_equals.cpp ├── atomic_max_expr_list_x.F90 ├── atomic_max_expr_list_x_end.F90 ├── atomic_max_expr_x.F90 ├── atomic_max_expr_x_end.F90 ├── atomic_max_x_expr.F90 ├── atomic_max_x_expr_end.F90 ├── atomic_max_x_expr_list.F90 ├── atomic_max_x_expr_list_end.F90 ├── atomic_min_expr_list_x.F90 ├── atomic_min_expr_list_x_end.F90 ├── atomic_min_expr_x.F90 ├── atomic_min_expr_x_end.F90 ├── atomic_min_x_expr.F90 ├── atomic_min_x_expr_end.F90 ├── atomic_min_x_expr_list.F90 ├── atomic_min_x_expr_list_end.F90 ├── atomic_minus_equals.c ├── atomic_minus_equals.cpp ├── atomic_multiply_equals.c ├── atomic_multiply_equals.cpp ├── atomic_plus_equals.c ├── atomic_plus_equals.cpp ├── atomic_postdecrement.c ├── atomic_postdecrement.cpp ├── atomic_postincrement.c ├── atomic_postincrement.cpp ├── atomic_predecrement.c ├── atomic_predecrement.cpp ├── atomic_preincrement.c ├── atomic_preincrement.cpp ├── atomic_rshift_equals.c ├── atomic_rshift_equals.cpp ├── atomic_structured_assign_assign.c ├── atomic_structured_assign_assign.cpp ├── atomic_structured_assign_bitand_equals.c ├── atomic_structured_assign_bitand_equals.cpp ├── atomic_structured_assign_bitor_equals.c ├── atomic_structured_assign_bitor_equals.cpp ├── atomic_structured_assign_bitxor_equals.c ├── atomic_structured_assign_bitxor_equals.cpp ├── atomic_structured_assign_divided_equals.c ├── atomic_structured_assign_divided_equals.cpp ├── atomic_structured_assign_expr_bitand_x.c ├── atomic_structured_assign_expr_bitand_x.cpp ├── atomic_structured_assign_expr_bitor_x.c ├── atomic_structured_assign_expr_bitor_x.cpp ├── atomic_structured_assign_expr_bitxor_x.c ├── atomic_structured_assign_expr_bitxor_x.cpp ├── atomic_structured_assign_expr_divided_x.c ├── atomic_structured_assign_expr_divided_x.cpp ├── atomic_structured_assign_expr_multiply_x.c ├── atomic_structured_assign_expr_multiply_x.cpp ├── atomic_structured_assign_expr_plus_x.c ├── atomic_structured_assign_expr_plus_x.cpp ├── atomic_structured_assign_lshift_equals.c ├── atomic_structured_assign_lshift_equals.cpp ├── atomic_structured_assign_minus_equals.c ├── atomic_structured_assign_minus_equals.cpp ├── atomic_structured_assign_multiply_equals.c ├── atomic_structured_assign_multiply_equals.cpp ├── atomic_structured_assign_plus_equals.c ├── atomic_structured_assign_plus_equals.cpp ├── atomic_structured_assign_postdecrement.c ├── atomic_structured_assign_postdecrement.cpp ├── atomic_structured_assign_postincrement.c ├── atomic_structured_assign_postincrement.cpp ├── atomic_structured_assign_predecrement.c ├── atomic_structured_assign_predecrement.cpp ├── atomic_structured_assign_preincrement.c ├── atomic_structured_assign_preincrement.cpp ├── atomic_structured_assign_rshift_equals.c ├── atomic_structured_assign_rshift_equals.cpp ├── atomic_structured_assign_x_bitand_expr.c ├── atomic_structured_assign_x_bitand_expr.cpp ├── atomic_structured_assign_x_bitor_expr.c ├── atomic_structured_assign_x_bitor_expr.cpp ├── atomic_structured_assign_x_bitxor_expr.c ├── atomic_structured_assign_x_bitxor_expr.cpp ├── atomic_structured_assign_x_divided_expr.c ├── atomic_structured_assign_x_divided_expr.cpp ├── atomic_structured_assign_x_lshift_expr.c ├── atomic_structured_assign_x_lshift_expr.cpp ├── atomic_structured_assign_x_minus_expr.c ├── atomic_structured_assign_x_minus_expr.cpp ├── atomic_structured_assign_x_multiply_expr.c ├── atomic_structured_assign_x_multiply_expr.cpp ├── atomic_structured_assign_x_plus_expr.c ├── atomic_structured_assign_x_plus_expr.cpp ├── atomic_structured_assign_x_rshift_expr.c ├── atomic_structured_assign_x_rshift_expr.cpp ├── atomic_structured_bitand_equals_assign.c ├── atomic_structured_bitand_equals_assign.cpp ├── atomic_structured_bitor_equals_assign.c ├── atomic_structured_bitor_equals_assign.cpp ├── atomic_structured_bitxor_equals_assign.c ├── atomic_structured_bitxor_equals_assign.cpp ├── atomic_structured_divided_equals_assign.c ├── atomic_structured_divided_equals_assign.cpp ├── atomic_structured_expr_bitand_x_assign.c ├── atomic_structured_expr_bitand_x_assign.cpp ├── atomic_structured_expr_bitor_x_assign.c ├── atomic_structured_expr_bitor_x_assign.cpp ├── atomic_structured_expr_bitxor_x_assign.c ├── atomic_structured_expr_bitxor_x_assign.cpp ├── atomic_structured_expr_multiply_x_assign.c ├── atomic_structured_expr_multiply_x_assign.cpp ├── atomic_structured_expr_plus_x_assign.c ├── atomic_structured_expr_plus_x_assign.cpp ├── atomic_structured_lshift_equals_assign.c ├── atomic_structured_lshift_equals_assign.cpp ├── atomic_structured_minus_equals_assign.c ├── atomic_structured_minus_equals_assign.cpp ├── atomic_structured_multiply_equals_assign.c ├── atomic_structured_multiply_equals_assign.cpp ├── atomic_structured_plus_equals_assign.c ├── atomic_structured_plus_equals_assign.cpp ├── atomic_structured_postdecrement_assign.c ├── atomic_structured_postdecrement_assign.cpp ├── atomic_structured_postincrement_assign.c ├── atomic_structured_postincrement_assign.cpp ├── atomic_structured_predecrement_assign.c ├── atomic_structured_predecrement_assign.cpp ├── atomic_structured_preincrement_assign.c ├── atomic_structured_preincrement_assign.cpp ├── atomic_structured_rshift_equals_assign.c ├── atomic_structured_rshift_equals_assign.cpp ├── atomic_structured_x_bitand_expr_assign.c ├── atomic_structured_x_bitand_expr_assign.cpp ├── atomic_structured_x_bitor_expr_assign.c ├── atomic_structured_x_bitor_expr_assign.cpp ├── atomic_structured_x_bitxor_expr_assign.c ├── atomic_structured_x_bitxor_expr_assign.cpp ├── atomic_structured_x_divided_expr_assign.c ├── atomic_structured_x_divided_expr_assign.cpp ├── atomic_structured_x_lshift_expr_assign.c ├── atomic_structured_x_lshift_expr_assign.cpp ├── atomic_structured_x_minus_expr_assign.c ├── atomic_structured_x_minus_expr_assign.cpp ├── atomic_structured_x_multiply_expr_assign.c ├── atomic_structured_x_multiply_expr_assign.cpp ├── atomic_structured_x_plus_expr_assign.c ├── atomic_structured_x_plus_expr_assign.cpp ├── atomic_structured_x_rshift_expr_assign.c ├── atomic_structured_x_rshift_expr_assign.cpp ├── atomic_update_bitand_equals.c ├── atomic_update_bitand_equals.cpp ├── atomic_update_bitor_equals.c ├── atomic_update_bitor_equals.cpp ├── atomic_update_bitxor_equals.c ├── atomic_update_bitxor_equals.cpp ├── atomic_update_divided_equals.c ├── atomic_update_divided_equals.cpp ├── atomic_update_expr_and_x.F90 ├── atomic_update_expr_and_x_end.F90 ├── atomic_update_expr_bitand_x.c ├── atomic_update_expr_bitand_x.cpp ├── atomic_update_expr_bitor_x.c ├── atomic_update_expr_bitor_x.cpp ├── atomic_update_expr_bitxor_x.c ├── atomic_update_expr_bitxor_x.cpp ├── atomic_update_expr_divided_x.F90 ├── atomic_update_expr_divided_x.c ├── atomic_update_expr_divided_x.cpp ├── atomic_update_expr_divided_x_end.F90 ├── atomic_update_expr_eqv_x.F90 ├── atomic_update_expr_eqv_x_end.F90 ├── atomic_update_expr_lshift_x.c ├── atomic_update_expr_lshift_x.cpp ├── atomic_update_expr_minus_x.F90 ├── atomic_update_expr_minus_x.c ├── atomic_update_expr_minus_x.cpp ├── atomic_update_expr_minus_x_end.F90 ├── atomic_update_expr_multiply_x.c ├── atomic_update_expr_multiply_x.cpp ├── atomic_update_expr_neqv_x.F90 ├── atomic_update_expr_neqv_x_end.F90 ├── atomic_update_expr_or_x.F90 ├── atomic_update_expr_or_x_end.F90 ├── atomic_update_expr_plus_x.F90 ├── atomic_update_expr_plus_x.c ├── atomic_update_expr_plus_x.cpp ├── atomic_update_expr_plus_x_end.F90 ├── atomic_update_expr_rshift_x.c ├── atomic_update_expr_rshift_x.cpp ├── atomic_update_expr_times_x.F90 ├── atomic_update_expr_times_x_end.F90 ├── atomic_update_iand_expr_x.F90 ├── atomic_update_iand_expr_x_end.F90 ├── atomic_update_iand_x_expr.F90 ├── atomic_update_iand_x_expr_end.F90 ├── atomic_update_ior_expr_x.F90 ├── atomic_update_ior_expr_x_end.F90 ├── atomic_update_ior_x_expr.F90 ├── atomic_update_ior_x_expr_end.F90 ├── atomic_update_ixor_expr_x.F90 ├── atomic_update_ixor_expr_x_end.F90 ├── atomic_update_ixor_x_expr.F90 ├── atomic_update_ixor_x_expr_end.F90 ├── atomic_update_lshift_equals.c ├── atomic_update_lshift_equals.cpp ├── atomic_update_max_expr_list_x.F90 ├── atomic_update_max_expr_list_x_end.F90 ├── atomic_update_max_expr_x.F90 ├── atomic_update_max_expr_x_end.F90 ├── atomic_update_max_x_expr.F90 ├── atomic_update_max_x_expr_end.F90 ├── atomic_update_max_x_expr_list.F90 ├── atomic_update_max_x_expr_list_end.F90 ├── atomic_update_min_expr_list_x.F90 ├── atomic_update_min_expr_list_x_end.F90 ├── atomic_update_min_expr_x.F90 ├── atomic_update_min_expr_x_end.F90 ├── atomic_update_min_x_expr.F90 ├── atomic_update_min_x_expr_end.F90 ├── atomic_update_min_x_expr_list.F90 ├── atomic_update_min_x_expr_list_end.F90 ├── atomic_update_minus_equals.c ├── atomic_update_minus_equals.cpp ├── atomic_update_multiply_equals.c ├── atomic_update_multiply_equals.cpp ├── atomic_update_plus_equals.c ├── atomic_update_plus_equals.cpp ├── atomic_update_postdecrement.c ├── atomic_update_postdecrement.cpp ├── atomic_update_postincrement.c ├── atomic_update_postincrement.cpp ├── atomic_update_predecrement.c ├── atomic_update_predecrement.cpp ├── atomic_update_preincrement.c ├── atomic_update_preincrement.cpp ├── atomic_update_rshift_equals.c ├── atomic_update_rshift_equals.cpp ├── atomic_update_x_and_expr.F90 ├── atomic_update_x_and_expr_end.F90 ├── atomic_update_x_bitand_expr.c ├── atomic_update_x_bitand_expr.cpp ├── atomic_update_x_bitor_expr.c ├── atomic_update_x_bitor_expr.cpp ├── atomic_update_x_bitxor_expr.c ├── atomic_update_x_bitxor_expr.cpp ├── atomic_update_x_divided_expr.F90 ├── atomic_update_x_divided_expr.c ├── atomic_update_x_divided_expr.cpp ├── atomic_update_x_divided_expr_end.F90 ├── atomic_update_x_eqv_expr.F90 ├── atomic_update_x_eqv_expr_end.F90 ├── atomic_update_x_lshift_expr.c ├── atomic_update_x_lshift_expr.cpp ├── atomic_update_x_minus_expr.F90 ├── atomic_update_x_minus_expr.c ├── atomic_update_x_minus_expr.cpp ├── atomic_update_x_minus_expr_end.F90 ├── atomic_update_x_multiply_expr.c ├── atomic_update_x_multiply_expr.cpp ├── atomic_update_x_neqv_expr.F90 ├── atomic_update_x_neqv_expr_end.F90 ├── atomic_update_x_or_expr.F90 ├── atomic_update_x_or_expr_end.F90 ├── atomic_update_x_plus_expr.F90 ├── atomic_update_x_plus_expr.c ├── atomic_update_x_plus_expr.cpp ├── atomic_update_x_plus_expr_end.F90 ├── atomic_update_x_rshift_expr.c ├── atomic_update_x_rshift_expr.cpp ├── atomic_update_x_times_expr.F90 ├── atomic_update_x_times_expr_end.F90 ├── atomic_x_and_expr.F90 ├── atomic_x_and_expr_end.F90 ├── atomic_x_bitand_expr.c ├── atomic_x_bitand_expr.cpp ├── atomic_x_bitor_expr.c ├── atomic_x_bitor_expr.cpp ├── atomic_x_bitxor_expr.c ├── atomic_x_bitxor_expr.cpp ├── atomic_x_divided_expr.F90 ├── atomic_x_divided_expr.c ├── atomic_x_divided_expr.cpp ├── atomic_x_divided_expr_end.F90 ├── atomic_x_eqv_expr.F90 ├── atomic_x_eqv_expr_end.F90 ├── atomic_x_lshift_expr.c ├── atomic_x_lshift_expr.cpp ├── atomic_x_minus_expr.F90 ├── atomic_x_minus_expr.c ├── atomic_x_minus_expr.cpp ├── atomic_x_minus_expr_end.F90 ├── atomic_x_multiply_expr.c ├── atomic_x_multiply_expr.cpp ├── atomic_x_neqv_expr.F90 ├── atomic_x_neqv_expr_end.F90 ├── atomic_x_or_expr.F90 ├── atomic_x_or_expr_end.F90 ├── atomic_x_plus_expr.F90 ├── atomic_x_plus_expr.c ├── atomic_x_plus_expr.cpp ├── atomic_x_plus_expr_end.F90 ├── atomic_x_rshift_expr.c ├── atomic_x_rshift_expr.cpp ├── atomic_x_times_expr.F90 ├── atomic_x_times_expr_end.F90 ├── copy_copyout.c ├── copy_copyout.cpp ├── copyin_copyout.c ├── copyin_copyout.cpp ├── data_async.c ├── data_async.cpp ├── data_copy_no_lower_bound.F90 ├── data_copy_no_lower_bound.c ├── data_copy_no_lower_bound.cpp ├── data_copyin_no_lower_bound.F90 ├── data_copyin_no_lower_bound.c ├── data_copyin_no_lower_bound.cpp ├── data_copyout_no_lower_bound.F90 ├── data_copyout_no_lower_bound.c ├── data_copyout_no_lower_bound.cpp ├── data_copyout_reference_counts.F90 ├── data_copyout_reference_counts.c ├── data_copyout_reference_counts.cpp ├── data_copyout_zero.c ├── data_copyout_zero.cpp ├── data_create.F90 ├── data_create.c ├── data_create.cpp ├── data_create_no_lower_bound.F90 ├── data_create_no_lower_bound.c ├── data_create_no_lower_bound.cpp ├── data_create_zero.c ├── data_create_zero.cpp ├── data_present_no_lower_bound.F90 ├── data_present_no_lower_bound.c ├── data_present_no_lower_bound.cpp ├── data_wait.c ├── data_wait.cpp ├── data_with_changing_subscript.F90 ├── data_with_changing_subscript.c ├── data_with_changing_subscript.cpp ├── data_with_derived_type.F90 ├── data_with_structs.c ├── data_with_structs.cpp ├── declare_copyin.F90 ├── declare_copyin.c ├── declare_copyin.cpp ├── declare_copyin_mod.F90 ├── declare_create.F90 ├── declare_create.c ├── declare_create.cpp ├── declare_device_resident.c ├── declare_device_resident.cpp ├── declare_function_scope_copy.F90 ├── declare_function_scope_copy.c ├── declare_function_scope_copy.cpp ├── declare_function_scope_copyin.F90 ├── declare_function_scope_copyin.c ├── declare_function_scope_copyin.cpp ├── declare_function_scope_copyout.F90 ├── declare_function_scope_copyout.c ├── declare_function_scope_copyout.cpp ├── declare_function_scope_create.F90 ├── declare_function_scope_create.c ├── declare_function_scope_create.cpp ├── declare_function_scope_deviceptr.c ├── declare_function_scope_deviceptr.cpp ├── declare_function_scope_present.F90 ├── declare_function_scope_present.c ├── declare_function_scope_present.cpp ├── enter_data_attach.c ├── enter_data_copyin_no_lower_bound.F90 ├── enter_data_copyin_no_lower_bound.c ├── enter_data_copyin_no_lower_bound.cpp ├── enter_data_create.F90 ├── enter_data_create.c ├── enter_data_create.cpp ├── enter_data_create_no_lower_bound.F90 ├── enter_data_create_no_lower_bound.c ├── enter_data_create_no_lower_bound.cpp ├── enter_data_if.F90 ├── enter_exit_data_if.c ├── enter_exit_data_if.cpp ├── exit_data.F90 ├── exit_data.c ├── exit_data.cpp ├── exit_data_copyout_no_lower_bound.F90 ├── exit_data_copyout_no_lower_bound.c ├── exit_data_copyout_no_lower_bound.cpp ├── exit_data_copyout_reference_counts.F90 ├── exit_data_copyout_reference_counts.c ├── exit_data_copyout_reference_counts.cpp ├── exit_data_delete_no_lower_bound.F90 ├── exit_data_delete_no_lower_bound.c ├── exit_data_delete_no_lower_bound.cpp ├── exit_data_detach.c ├── exit_data_finalize.F90 ├── exit_data_finalize.c ├── exit_data_finalize.cpp ├── gang_dimensions.c ├── host_data.c ├── host_data.cpp ├── init.F90 ├── init.c ├── init.cpp ├── init_device_num.F90 ├── init_device_num.c ├── init_device_num.cpp ├── init_device_type.F90 ├── init_device_type.c ├── init_device_type.cpp ├── init_device_type_num.F90 ├── init_device_type_num.c ├── init_device_type_num.cpp ├── init_device_type_num_nvidia.F90 ├── init_device_type_num_nvidia.c ├── init_device_type_num_nvidia.cpp ├── init_device_type_nvidia.F90 ├── init_device_type_nvidia.c ├── init_device_type_nvidia.cpp ├── init_if.c ├── init_if.cpp ├── kernel_implicit_data_attributes.c ├── kernel_implicit_data_attributes.cpp ├── kernels_async.F90 ├── kernels_async.c ├── kernels_async.cpp ├── kernels_copy.F90 ├── kernels_copy.c ├── kernels_copy.cpp ├── kernels_copyin.F90 ├── kernels_copyin.c ├── kernels_copyin.cpp ├── kernels_copyout.F90 ├── kernels_copyout.c ├── kernels_copyout.cpp ├── kernels_copyout_zero.c ├── kernels_copyout_zero.cpp ├── kernels_create.F90 ├── kernels_create.c ├── kernels_create.cpp ├── kernels_create_zero.c ├── kernels_create_zero.cpp ├── kernels_default_copy.F90 ├── kernels_default_copy.c ├── kernels_default_copy.cpp ├── kernels_default_present.F90 ├── kernels_default_present.c ├── kernels_default_present.cpp ├── kernels_if.F90 ├── kernels_if.c ├── kernels_if.cpp ├── kernels_loop.F90 ├── kernels_loop.c ├── kernels_loop.cpp ├── kernels_loop_independent.F90 ├── kernels_loop_independent.c ├── kernels_loop_independent.cpp ├── kernels_loop_reduction_add_general.F90 ├── kernels_loop_reduction_add_general.c ├── kernels_loop_reduction_add_general.cpp ├── kernels_loop_reduction_add_loop.F90 ├── kernels_loop_reduction_add_loop.c ├── kernels_loop_reduction_add_loop.cpp ├── kernels_loop_reduction_add_vector_loop.F90 ├── kernels_loop_reduction_add_vector_loop.c ├── kernels_loop_reduction_add_vector_loop.cpp ├── kernels_loop_reduction_and_general.F90 ├── kernels_loop_reduction_and_general.c ├── kernels_loop_reduction_and_general.cpp ├── kernels_loop_reduction_and_loop.F90 ├── kernels_loop_reduction_and_loop.c ├── kernels_loop_reduction_and_loop.cpp ├── kernels_loop_reduction_and_vector_loop.F90 ├── kernels_loop_reduction_and_vector_loop.c ├── kernels_loop_reduction_and_vector_loop.cpp ├── kernels_loop_reduction_bitand_general.F90 ├── kernels_loop_reduction_bitand_general.c ├── kernels_loop_reduction_bitand_general.cpp ├── kernels_loop_reduction_bitand_loop.F90 ├── kernels_loop_reduction_bitand_loop.c ├── kernels_loop_reduction_bitand_loop.cpp ├── kernels_loop_reduction_bitand_vector_loop.F90 ├── kernels_loop_reduction_bitand_vector_loop.c ├── kernels_loop_reduction_bitand_vector_loop.cpp ├── kernels_loop_reduction_bitor_general.F90 ├── kernels_loop_reduction_bitor_general.c ├── kernels_loop_reduction_bitor_general.cpp ├── kernels_loop_reduction_bitor_loop.F90 ├── kernels_loop_reduction_bitor_loop.c ├── kernels_loop_reduction_bitor_loop.cpp ├── kernels_loop_reduction_bitor_vector_loop.F90 ├── kernels_loop_reduction_bitor_vector_loop.c ├── kernels_loop_reduction_bitor_vector_loop.cpp ├── kernels_loop_reduction_bitxor_general.F90 ├── kernels_loop_reduction_bitxor_general.c ├── kernels_loop_reduction_bitxor_general.cpp ├── kernels_loop_reduction_bitxor_loop.F90 ├── kernels_loop_reduction_bitxor_loop.c ├── kernels_loop_reduction_bitxor_loop.cpp ├── kernels_loop_reduction_bitxor_vector_loop.F90 ├── kernels_loop_reduction_bitxor_vector_loop.c ├── kernels_loop_reduction_bitxor_vector_loop.cpp ├── kernels_loop_reduction_max_general.F90 ├── kernels_loop_reduction_max_general.c ├── kernels_loop_reduction_max_general.cpp ├── kernels_loop_reduction_max_loop.F90 ├── kernels_loop_reduction_max_loop.c ├── kernels_loop_reduction_max_loop.cpp ├── kernels_loop_reduction_max_vector_loop.F90 ├── kernels_loop_reduction_max_vector_loop.c ├── kernels_loop_reduction_max_vector_loop.cpp ├── kernels_loop_reduction_min_general.F90 ├── kernels_loop_reduction_min_general.c ├── kernels_loop_reduction_min_general.cpp ├── kernels_loop_reduction_min_loop.F90 ├── kernels_loop_reduction_min_loop.c ├── kernels_loop_reduction_min_loop.cpp ├── kernels_loop_reduction_min_vector_loop.F90 ├── kernels_loop_reduction_min_vector_loop.c ├── kernels_loop_reduction_min_vector_loop.cpp ├── kernels_loop_reduction_multiply_general.F90 ├── kernels_loop_reduction_multiply_general.c ├── kernels_loop_reduction_multiply_general.cpp ├── kernels_loop_reduction_multiply_loop.F90 ├── kernels_loop_reduction_multiply_loop.c ├── kernels_loop_reduction_multiply_loop.cpp ├── kernels_loop_reduction_multiply_vector_loop.F90 ├── kernels_loop_reduction_multiply_vector_loop.c ├── kernels_loop_reduction_multiply_vector_loop.cpp ├── kernels_loop_reduction_or_general.F90 ├── kernels_loop_reduction_or_general.c ├── kernels_loop_reduction_or_general.cpp ├── kernels_loop_reduction_or_loop.F90 ├── kernels_loop_reduction_or_loop.c ├── kernels_loop_reduction_or_loop.cpp ├── kernels_loop_reduction_or_vector_loop.F90 ├── kernels_loop_reduction_or_vector_loop.c ├── kernels_loop_reduction_or_vector_loop.cpp ├── kernels_loop_seq.F90 ├── kernels_loop_seq.c ├── kernels_loop_seq.cpp ├── kernels_loop_tile.F90 ├── kernels_loop_tile.c ├── kernels_loop_tile.cpp ├── kernels_loop_vector_blocking.F90 ├── kernels_loop_vector_blocking.c ├── kernels_loop_vector_blocking.cpp ├── kernels_loop_worker_blocking.F90 ├── kernels_loop_worker_blocking.c ├── kernels_loop_worker_blocking.cpp ├── kernels_num_gangs.F90 ├── kernels_num_gangs.c ├── kernels_num_gangs.cpp ├── kernels_num_workers.F90 ├── kernels_num_workers.c ├── kernels_num_workers.cpp ├── kernels_present.F90 ├── kernels_present.c ├── kernels_present.cpp ├── kernels_scalar_default_copy.F90 ├── kernels_scalar_default_copy.c ├── kernels_scalar_default_copy.cpp ├── kernels_vector_length.F90 ├── kernels_vector_length.c ├── kernels_vector_length.cpp ├── kernels_wait.F90 ├── kernels_wait.c ├── kernels_wait.cpp ├── loop_collapse.F90 ├── loop_collapse.c ├── loop_collapse.cpp ├── loop_no_collapse.F90 ├── loop_no_collapse_default.c ├── loop_no_collapse_default.cpp ├── parallel.F90 ├── parallel.c ├── parallel.cpp ├── parallel_async.F90 ├── parallel_async.c ├── parallel_async.cpp ├── parallel_copy.F90 ├── parallel_copy.c ├── parallel_copy.cpp ├── parallel_copyin.F90 ├── parallel_copyin.c ├── parallel_copyin.cpp ├── parallel_copyout.F90 ├── parallel_copyout.c ├── parallel_copyout.cpp ├── parallel_copyout_zero.c ├── parallel_copyout_zero.cpp ├── parallel_create.F90 ├── parallel_create.c ├── parallel_create.cpp ├── parallel_create_zero.c ├── parallel_create_zero.cpp ├── parallel_default_copy.F90 ├── parallel_default_copy.c ├── parallel_default_copy.cpp ├── parallel_default_present.F90 ├── parallel_default_present.c ├── parallel_default_present.cpp ├── parallel_deviceptr.c ├── parallel_deviceptr.cpp ├── parallel_firstprivate.F90 ├── parallel_firstprivate.c ├── parallel_firstprivate.cpp ├── parallel_if.F90 ├── parallel_if.c ├── parallel_if.cpp ├── parallel_implicit_data_attributes.c ├── parallel_implicit_data_attributes.cpp ├── parallel_independent_atomic.c ├── parallel_independent_atomic.cpp ├── parallel_independent_atomic_capture.c ├── parallel_independent_atomic_capture.cpp ├── parallel_independent_atomic_read.c ├── parallel_independent_atomic_read.cpp ├── parallel_independent_atomic_update.c ├── parallel_independent_atomic_update.cpp ├── parallel_independent_atomic_write.c ├── parallel_independent_atomic_write.cpp ├── parallel_loop.F90 ├── parallel_loop.c ├── parallel_loop.cpp ├── parallel_loop_async.F90 ├── parallel_loop_async.c ├── parallel_loop_async.cpp ├── parallel_loop_auto.F90 ├── parallel_loop_auto.c ├── parallel_loop_auto.cpp ├── parallel_loop_block.F90 ├── parallel_loop_gang.F90 ├── parallel_loop_gang.c ├── parallel_loop_gang.cpp ├── parallel_loop_independent.c ├── parallel_loop_independent.cpp ├── parallel_loop_independent_reduction.c ├── parallel_loop_independent_reduction.cpp ├── parallel_loop_reduction_add_general.F90 ├── parallel_loop_reduction_add_general.c ├── parallel_loop_reduction_add_general.cpp ├── parallel_loop_reduction_add_general_type_check_pt1.c ├── parallel_loop_reduction_add_general_type_check_pt1.cpp ├── parallel_loop_reduction_add_general_type_check_pt2.c ├── parallel_loop_reduction_add_general_type_check_pt2.cpp ├── parallel_loop_reduction_add_general_type_check_pt3.c ├── parallel_loop_reduction_add_general_type_check_pt3.cpp ├── parallel_loop_reduction_add_loop.F90 ├── parallel_loop_reduction_add_loop.c ├── parallel_loop_reduction_add_loop.cpp ├── parallel_loop_reduction_add_loop_type_check_pt1.c ├── parallel_loop_reduction_add_loop_type_check_pt1.cpp ├── parallel_loop_reduction_add_vector_loop.F90 ├── parallel_loop_reduction_add_vector_loop.c ├── parallel_loop_reduction_add_vector_loop.cpp ├── parallel_loop_reduction_and_general.F90 ├── parallel_loop_reduction_and_general.c ├── parallel_loop_reduction_and_general.cpp ├── parallel_loop_reduction_and_loop.F90 ├── parallel_loop_reduction_and_loop.c ├── parallel_loop_reduction_and_loop.cpp ├── parallel_loop_reduction_and_vector_loop.F90 ├── parallel_loop_reduction_and_vector_loop.c ├── parallel_loop_reduction_and_vector_loop.cpp ├── parallel_loop_reduction_bitand_general.F90 ├── parallel_loop_reduction_bitand_general.c ├── parallel_loop_reduction_bitand_general.cpp ├── parallel_loop_reduction_bitand_loop.F90 ├── parallel_loop_reduction_bitand_loop.c ├── parallel_loop_reduction_bitand_loop.cpp ├── parallel_loop_reduction_bitand_vector_loop.F90 ├── parallel_loop_reduction_bitand_vector_loop.c ├── parallel_loop_reduction_bitand_vector_loop.cpp ├── parallel_loop_reduction_bitor_general.F90 ├── parallel_loop_reduction_bitor_general.c ├── parallel_loop_reduction_bitor_general.cpp ├── parallel_loop_reduction_bitor_loop.F90 ├── parallel_loop_reduction_bitor_loop.c ├── parallel_loop_reduction_bitor_loop.cpp ├── parallel_loop_reduction_bitor_vector_loop.F90 ├── parallel_loop_reduction_bitor_vector_loop.c ├── parallel_loop_reduction_bitor_vector_loop.cpp ├── parallel_loop_reduction_bitxor_general.F90 ├── parallel_loop_reduction_bitxor_general.c ├── parallel_loop_reduction_bitxor_general.cpp ├── parallel_loop_reduction_bitxor_loop.F90 ├── parallel_loop_reduction_bitxor_loop.c ├── parallel_loop_reduction_bitxor_loop.cpp ├── parallel_loop_reduction_bitxor_vector_loop.F90 ├── parallel_loop_reduction_bitxor_vector_loop.c ├── parallel_loop_reduction_bitxor_vector_loop.cpp ├── parallel_loop_reduction_max_general.F90 ├── parallel_loop_reduction_max_general.c ├── parallel_loop_reduction_max_general.cpp ├── parallel_loop_reduction_max_loop.F90 ├── parallel_loop_reduction_max_loop.c ├── parallel_loop_reduction_max_loop.cpp ├── parallel_loop_reduction_max_vector_loop.F90 ├── parallel_loop_reduction_max_vector_loop.c ├── parallel_loop_reduction_max_vector_loop.cpp ├── parallel_loop_reduction_min_general.F90 ├── parallel_loop_reduction_min_general.c ├── parallel_loop_reduction_min_general.cpp ├── parallel_loop_reduction_min_loop.F90 ├── parallel_loop_reduction_min_loop.c ├── parallel_loop_reduction_min_loop.cpp ├── parallel_loop_reduction_min_vector_loop.F90 ├── parallel_loop_reduction_min_vector_loop.c ├── parallel_loop_reduction_min_vector_loop.cpp ├── parallel_loop_reduction_multiply_general.F90 ├── parallel_loop_reduction_multiply_general.c ├── parallel_loop_reduction_multiply_general.cpp ├── parallel_loop_reduction_multiply_loop.F90 ├── parallel_loop_reduction_multiply_loop.c ├── parallel_loop_reduction_multiply_loop.cpp ├── parallel_loop_reduction_multiply_vector_loop.F90 ├── parallel_loop_reduction_multiply_vector_loop.c ├── parallel_loop_reduction_multiply_vector_loop.cpp ├── parallel_loop_reduction_or_general.F90 ├── parallel_loop_reduction_or_general.c ├── parallel_loop_reduction_or_general.cpp ├── parallel_loop_reduction_or_loop.F90 ├── parallel_loop_reduction_or_loop.c ├── parallel_loop_reduction_or_loop.cpp ├── parallel_loop_reduction_or_vector_loop.F90 ├── parallel_loop_reduction_or_vector_loop.c ├── parallel_loop_reduction_or_vector_loop.cpp ├── parallel_loop_seq.F90 ├── parallel_loop_seq.c ├── parallel_loop_seq.cpp ├── parallel_loop_tile.F90 ├── parallel_loop_tile.c ├── parallel_loop_tile.cpp ├── parallel_loop_vector.F90 ├── parallel_loop_vector.c ├── parallel_loop_vector.cpp ├── parallel_loop_vector_blocking.F90 ├── parallel_loop_vector_blocking.c ├── parallel_loop_vector_blocking.cpp ├── parallel_loop_worker.F90 ├── parallel_loop_worker.c ├── parallel_loop_worker.cpp ├── parallel_loop_worker_blocking.F90 ├── parallel_loop_worker_blocking.c ├── parallel_loop_worker_blocking.cpp ├── parallel_present.F90 ├── parallel_present.c ├── parallel_present.cpp ├── parallel_private.F90 ├── parallel_private.c ├── parallel_private.cpp ├── parallel_reduction.F90 ├── parallel_reduction.c ├── parallel_reduction.cpp ├── parallel_scalar_default_firstprivate.F90 ├── parallel_scalar_default_firstprivate.c ├── parallel_scalar_default_firstprivate.cpp ├── parallel_switch.F90 ├── parallel_switch.c ├── parallel_switch.cpp ├── parallel_wait.F90 ├── parallel_wait.c ├── parallel_wait.cpp ├── parallel_wait_devnum.c ├── parallel_wait_devnum.cpp ├── parallel_wait_queue.c ├── parallel_wait_queue.cpp ├── parallel_while_loop.F90 ├── parallel_while_loop.c ├── parallel_while_loop.cpp ├── reference_count_zero.c ├── reference_count_zero.cpp ├── routine_bind.c ├── routine_bind.cpp ├── routine_bind_nonprototype_function_nonstring_function.cpp ├── routine_bind_nonprototype_function_nonstring_lambda.cpp ├── routine_bind_nonprototype_function_string_function.cpp ├── routine_bind_nonprototype_function_string_lambda.cpp ├── routine_bind_nonprototype_lambda_nonstring_function.cpp ├── routine_bind_nonprototype_lambda_nonstring_lambda.cpp ├── routine_bind_nonprototype_lambda_string_function.cpp ├── routine_bind_nonprototype_lambda_string_lambda.cpp ├── routine_bind_prototype_function_nonstring_function.cpp ├── routine_bind_prototype_function_nonstring_lambda.cpp ├── routine_bind_prototype_function_string_function.cpp ├── routine_bind_prototype_function_string_lambda.cpp ├── routine_bind_prototype_lambda_nonstring_function.cpp ├── routine_bind_prototype_lambda_nonstring_lambda.cpp ├── routine_bind_prototype_lambda_string_function.cpp ├── routine_bind_prototype_lambda_string_lambda.cpp ├── routine_gang.c ├── routine_gang.cpp ├── routine_nohost.c ├── routine_nohost.cpp ├── routine_seq.c ├── routine_seq.cpp ├── routine_vector.c ├── routine_vector.cpp ├── routine_worker.c ├── routine_worker.cpp ├── serial.F90 ├── serial.c ├── serial.cpp ├── serial_async.F90 ├── serial_async.c ├── serial_async.cpp ├── serial_copy.F90 ├── serial_copy.c ├── serial_copy.cpp ├── serial_copyin.F90 ├── serial_copyin.c ├── serial_copyin.cpp ├── serial_copyout.F90 ├── serial_copyout.c ├── serial_copyout.cpp ├── serial_copyout_zero.c ├── serial_copyout_zero.cpp ├── serial_create.F90 ├── serial_create.c ├── serial_create.cpp ├── serial_create_zero.c ├── serial_create_zero.cpp ├── serial_default_copy.F90 ├── serial_default_copy.c ├── serial_default_copy.cpp ├── serial_default_present.F90 ├── serial_default_present.c ├── serial_default_present.cpp ├── serial_deviceptr.c ├── serial_deviceptr.cpp ├── serial_firstprivate.F90 ├── serial_firstprivate.c ├── serial_firstprivate.cpp ├── serial_if.F90 ├── serial_if.c ├── serial_if.cpp ├── serial_implicit_data_attributes.c ├── serial_implicit_data_attributes.cpp ├── serial_loop.F90 ├── serial_loop.c ├── serial_loop.cpp ├── serial_loop_async.F90 ├── serial_loop_async.c ├── serial_loop_async.cpp ├── serial_loop_auto.F90 ├── serial_loop_auto.c ├── serial_loop_auto.cpp ├── serial_loop_gang.F90 ├── serial_loop_gang.c ├── serial_loop_gang.cpp ├── serial_loop_gang_blocking.F90 ├── serial_loop_gang_blocking.c ├── serial_loop_gang_blocking.cpp ├── serial_loop_reduction_add_general.F90 ├── serial_loop_reduction_add_general.c ├── serial_loop_reduction_add_general.cpp ├── serial_loop_reduction_add_loop.F90 ├── serial_loop_reduction_add_loop.c ├── serial_loop_reduction_add_loop.cpp ├── serial_loop_reduction_add_vector_loop.F90 ├── serial_loop_reduction_add_vector_loop.c ├── serial_loop_reduction_add_vector_loop.cpp ├── serial_loop_reduction_and_general.F90 ├── serial_loop_reduction_and_general.c ├── serial_loop_reduction_and_general.cpp ├── serial_loop_reduction_and_loop.F90 ├── serial_loop_reduction_and_loop.c ├── serial_loop_reduction_and_loop.cpp ├── serial_loop_reduction_and_vector_loop.F90 ├── serial_loop_reduction_and_vector_loop.c ├── serial_loop_reduction_and_vector_loop.cpp ├── serial_loop_reduction_bitand_general.F90 ├── serial_loop_reduction_bitand_general.c ├── serial_loop_reduction_bitand_general.cpp ├── serial_loop_reduction_bitand_loop.F90 ├── serial_loop_reduction_bitand_loop.c ├── serial_loop_reduction_bitand_loop.cpp ├── serial_loop_reduction_bitand_vector_loop.F90 ├── serial_loop_reduction_bitand_vector_loop.c ├── serial_loop_reduction_bitand_vector_loop.cpp ├── serial_loop_reduction_bitor_general.F90 ├── serial_loop_reduction_bitor_general.c ├── serial_loop_reduction_bitor_general.cpp ├── serial_loop_reduction_bitor_loop.F90 ├── serial_loop_reduction_bitor_loop.c ├── serial_loop_reduction_bitor_loop.cpp ├── serial_loop_reduction_bitor_vector_loop.F90 ├── serial_loop_reduction_bitor_vector_loop.c ├── serial_loop_reduction_bitor_vector_loop.cpp ├── serial_loop_reduction_bitxor_general.F90 ├── serial_loop_reduction_bitxor_general.c ├── serial_loop_reduction_bitxor_general.cpp ├── serial_loop_reduction_bitxor_loop.F90 ├── serial_loop_reduction_bitxor_loop.c ├── serial_loop_reduction_bitxor_loop.cpp ├── serial_loop_reduction_bitxor_vector_loop.F90 ├── serial_loop_reduction_bitxor_vector_loop.c ├── serial_loop_reduction_bitxor_vector_loop.cpp ├── serial_loop_reduction_max_general.F90 ├── serial_loop_reduction_max_general.c ├── serial_loop_reduction_max_general.cpp ├── serial_loop_reduction_max_loop.F90 ├── serial_loop_reduction_max_loop.c ├── serial_loop_reduction_max_loop.cpp ├── serial_loop_reduction_max_vector_loop.F90 ├── serial_loop_reduction_max_vector_loop.c ├── serial_loop_reduction_max_vector_loop.cpp ├── serial_loop_reduction_min_general.F90 ├── serial_loop_reduction_min_general.c ├── serial_loop_reduction_min_general.cpp ├── serial_loop_reduction_min_loop.F90 ├── serial_loop_reduction_min_loop.c ├── serial_loop_reduction_min_loop.cpp ├── serial_loop_reduction_min_vector_loop.F90 ├── serial_loop_reduction_min_vector_loop.c ├── serial_loop_reduction_min_vector_loop.cpp ├── serial_loop_reduction_multiply_general.F90 ├── serial_loop_reduction_multiply_general.c ├── serial_loop_reduction_multiply_general.cpp ├── serial_loop_reduction_multiply_loop.F90 ├── serial_loop_reduction_multiply_loop.c ├── serial_loop_reduction_multiply_loop.cpp ├── serial_loop_reduction_multiply_vector_loop.F90 ├── serial_loop_reduction_multiply_vector_loop.c ├── serial_loop_reduction_multiply_vector_loop.cpp ├── serial_loop_reduction_or_general.F90 ├── serial_loop_reduction_or_general.c ├── serial_loop_reduction_or_general.cpp ├── serial_loop_reduction_or_loop.F90 ├── serial_loop_reduction_or_loop.c ├── serial_loop_reduction_or_loop.cpp ├── serial_loop_reduction_or_vector_loop.F90 ├── serial_loop_reduction_or_vector_loop.c ├── serial_loop_reduction_or_vector_loop.cpp ├── serial_loop_seq.F90 ├── serial_loop_seq.c ├── serial_loop_seq.cpp ├── serial_loop_tile.F90 ├── serial_loop_tile.c ├── serial_loop_tile.cpp ├── serial_loop_vector.F90 ├── serial_loop_vector.c ├── serial_loop_vector.cpp ├── serial_loop_vector_blocking.F90 ├── serial_loop_vector_blocking.c ├── serial_loop_vector_blocking.cpp ├── serial_loop_worker.F90 ├── serial_loop_worker.c ├── serial_loop_worker.cpp ├── serial_loop_worker_blocking.F90 ├── serial_loop_worker_blocking.c ├── serial_loop_worker_blocking.cpp ├── serial_present.F90 ├── serial_present.c ├── serial_present.cpp ├── serial_private.F90 ├── serial_private.c ├── serial_private.cpp ├── serial_reduction.F90 ├── serial_reduction.c ├── serial_reduction.cpp ├── serial_scalar_default_firstprivate.F90 ├── serial_scalar_default_firstprivate.c ├── serial_scalar_default_firstprivate.cpp ├── serial_switch.F90 ├── serial_switch.c ├── serial_switch.cpp ├── serial_wait.F90 ├── serial_wait.c ├── serial_wait.cpp ├── serial_while_loop.F90 ├── serial_while_loop.c ├── serial_while_loop.cpp ├── set_default_async.F90 ├── set_default_async.c ├── set_default_async.cpp ├── set_device_num.F90 ├── set_device_num.c ├── set_device_num.cpp ├── set_device_type.F90 ├── set_device_type.c ├── set_device_type.cpp ├── set_device_type_num.F90 ├── set_device_type_num.c ├── set_device_type_num.cpp ├── set_device_type_num_nvidia.F90 ├── set_device_type_num_nvidia.c ├── set_device_type_num_nvidia.cpp ├── set_device_type_nvidia.F90 ├── set_device_type_nvidia.c ├── set_device_type_nvidia.cpp ├── set_if.c ├── set_if.cpp ├── shutdown.F90 ├── shutdown.c ├── shutdown.cpp ├── shutdown_device_num.F90 ├── shutdown_device_num.c ├── shutdown_device_num.cpp ├── shutdown_device_type.F90 ├── shutdown_device_type.c ├── shutdown_device_type.cpp ├── shutdown_device_type_num.F90 ├── shutdown_device_type_num.c ├── shutdown_device_type_num.cpp ├── shutdown_device_type_num_nvidia.F90 ├── shutdown_device_type_num_nvidia.c ├── shutdown_device_type_num_nvidia.cpp ├── shutdown_device_type_nvidia.F90 ├── shutdown_device_type_nvidia.c ├── shutdown_device_type_nvidia.cpp ├── shutdown_if.c ├── shutdown_if.cpp ├── wait_devnum.c ├── wait_if.F90 ├── wait_if.c ├── wait_if.cpp ├── wait_if_devnum_false.cpp ├── wait_if_devnum_true.cpp ├── wait_if_queue_false.cpp └── wait_if_queue_true.cpp ├── UseCases └── .gitignore ├── construct_independent_mutator.py ├── images ├── OpenACCVVdarknew.png └── OpenACCVVwhitenew.png ├── infrastructure.py ├── init_config.txt ├── results_template ├── css │ ├── results.css │ └── third_party │ │ └── bootstrap.min.css ├── img │ └── OpenACC.jpg ├── js │ ├── results.js │ └── third_party │ │ ├── angular-animate.min.js │ │ ├── angular-route.min.js │ │ ├── angular-sanitize.min.js │ │ ├── angular-touch.min.js │ │ ├── angular-ui.min.js │ │ ├── angular.min.js │ │ ├── ansi2html.js │ │ ├── bootstrap.min.js │ │ ├── jquery-2.x.min.js │ │ ├── moment.min.js │ │ └── ui-bootstrap-tpls.min.js └── results.html ├── versiontest.F90 ├── versiontest.c └── versiontest.cpp /Tests/acc_free.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:runtime,data,executable-data,V:2.6-2.7 4 | int test1(){ 5 | int err = 0; 6 | int *a = (int *)acc_malloc(n * sizeof(int)); 7 | size_t initial_memory = acc_get_property(acc_get_device_num(acc_get_device_type()), acc_get_device_type(), acc_property_free_memory); 8 | 9 | acc_free(a); 10 | size_t final_memory = acc_get_property(acc_get_device_num(acc_get_device_type()), acc_get_device_type(), acc_property_free_memory); 11 | if (final_memory < initial_memory + n * sizeof(int)){ 12 | err += 1; 13 | } 14 | return err; 15 | } 16 | #endif 17 | 18 | int main(){ 19 | int failcode = 0; 20 | int failed; 21 | #ifndef T1 22 | failed = 0; 23 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 24 | failed = failed + test1(); 25 | } 26 | if (failed != 0){ 27 | failcode = failcode + (1 << 0); 28 | } 29 | #endif 30 | return failcode; 31 | } 32 | -------------------------------------------------------------------------------- /Tests/acc_free.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:runtime,data,executable-data,V:2.6-2.7 4 | int test1(){ 5 | int err = 0; 6 | int *a = (int *)acc_malloc(n * sizeof(int)); 7 | size_t initial_memory = acc_get_property(acc_get_device_num(acc_get_device_type()), acc_get_device_type(), acc_property_free_memory); 8 | 9 | acc_free(a); 10 | size_t final_memory = acc_get_property(acc_get_device_num(acc_get_device_type()), acc_get_device_type(), acc_property_free_memory); 11 | if (final_memory < initial_memory + n * sizeof(int)){ 12 | err += 1; 13 | } 14 | return err; 15 | } 16 | #endif 17 | 18 | int main(){ 19 | int failcode = 0; 20 | int failed; 21 | #ifndef T1 22 | failed = 0; 23 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 24 | failed = failed + test1(); 25 | } 26 | if (failed != 0){ 27 | failcode = failcode + (1 << 0); 28 | } 29 | #endif 30 | return failcode; 31 | } 32 | -------------------------------------------------------------------------------- /Tests/acc_get_device_num.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:runtime,devonly,internal-control-values,syntactic,V:1.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | 7 | if (acc_get_device_type() != acc_device_none){ 8 | for (int x = 0; x < acc_get_num_devices(acc_get_device_type()); ++x){ 9 | acc_set_device_num(x, acc_get_device_type()); 10 | if (acc_get_device_num(acc_get_device_type()) != x){ 11 | err += 1; 12 | } 13 | } 14 | } 15 | 16 | return err; 17 | } 18 | #endif 19 | 20 | int main(){ 21 | int failcode = 0; 22 | int failed; 23 | #ifndef T1 24 | failed = 0; 25 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 26 | failed = failed + test1(); 27 | } 28 | if (failed != 0){ 29 | failcode = failcode + (1 << 0); 30 | } 31 | #endif 32 | return failcode; 33 | } 34 | -------------------------------------------------------------------------------- /Tests/acc_get_device_num.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:runtime,devonly,internal-control-values,syntactic,V:1.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | 7 | if (acc_get_device_type() != acc_device_none){ 8 | for (int x = 0; x < acc_get_num_devices(acc_get_device_type()); ++x){ 9 | acc_set_device_num(x, acc_get_device_type()); 10 | if (acc_get_device_num(acc_get_device_type()) != x){ 11 | err += 1; 12 | } 13 | } 14 | } 15 | 16 | return err; 17 | } 18 | #endif 19 | 20 | int main(){ 21 | int failcode = 0; 22 | int failed; 23 | #ifndef T1 24 | failed = 0; 25 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 26 | failed = failed + test1(); 27 | } 28 | if (failed != 0){ 29 | failcode = failcode + (1 << 0); 30 | } 31 | #endif 32 | return failcode; 33 | } 34 | -------------------------------------------------------------------------------- /Tests/acc_get_device_type.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:,V:1.0-3.2 4 | int test1(){ 5 | int err = 0; 6 | 7 | int device_type = acc_get_device_type(); 8 | 9 | if (acc_get_device_type() != device_type){ 10 | err += 1; 11 | } 12 | 13 | return err; 14 | } 15 | #endif 16 | 17 | int main(){ 18 | int failcode = 0; 19 | int failed; 20 | #ifndef T1 21 | failed = 0; 22 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 23 | failed = failed + test1(); 24 | } 25 | if (failed != 0){ 26 | failcode = failcode + (1 << 0); 27 | } 28 | #endif 29 | return failcode; 30 | } 31 | -------------------------------------------------------------------------------- /Tests/acc_get_device_type.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:,V:1.0-3.2 4 | int test1(){ 5 | int err = 0; 6 | 7 | int device_type = acc_get_device_type(); 8 | 9 | if (acc_get_device_type() != device_type){ 10 | err += 1; 11 | } 12 | 13 | return err; 14 | } 15 | #endif 16 | 17 | int main(){ 18 | int failcode = 0; 19 | int failed; 20 | #ifndef T1 21 | failed = 0; 22 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 23 | failed = failed + test1(); 24 | } 25 | if (failed != 0){ 26 | failcode = failcode + (1 << 0); 27 | } 28 | #endif 29 | return failcode; 30 | } 31 | -------------------------------------------------------------------------------- /Tests/acc_get_num_devices.F90: -------------------------------------------------------------------------------- 1 | #ifndef T1 2 | !T1:runtime,construct-independent,internal-control-values,V:1.0-2.7 3 | LOGICAL FUNCTION test1() 4 | USE OPENACC 5 | IMPLICIT NONE 6 | INCLUDE "acc_testsuite.Fh" 7 | INTEGER :: errors 8 | errors = 0 9 | 10 | IF (acc_get_device_type() .ne. acc_device_none) THEN 11 | IF (acc_get_num_devices(acc_get_device_type()) .eq. 0) THEN 12 | errors = errors + 1 13 | END IF 14 | END IF 15 | 16 | IF (errors .eq. 0) THEN 17 | test1 = .FALSE. 18 | ELSE 19 | test1 = .TRUE. 20 | END IF 21 | END 22 | #endif 23 | 24 | 25 | PROGRAM main 26 | IMPLICIT NONE 27 | INTEGER :: failcode, testrun 28 | LOGICAL :: failed 29 | INCLUDE "acc_testsuite.Fh" 30 | !Conditionally define test functions 31 | #ifndef T1 32 | LOGICAL :: test1 33 | #endif 34 | failcode = 0 35 | failed = .FALSE. 36 | 37 | #ifndef T1 38 | DO testrun = 1, NUM_TEST_CALLS 39 | failed = failed .or. test1() 40 | END DO 41 | IF (failed) THEN 42 | failcode = failcode + 2 ** 0 43 | failed = .FALSE. 44 | END IF 45 | #endif 46 | CALL EXIT (failcode) 47 | END PROGRAM 48 | 49 | -------------------------------------------------------------------------------- /Tests/acc_get_num_devices.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:runtime,devonly,internal-control-values,syntactic,V:1.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | 7 | if(acc_get_device_type() != acc_device_none && acc_get_num_devices(acc_get_device_type()) == 0){ //Can't have zero of current device type 8 | err += 1; 9 | } 10 | 11 | return err; 12 | } 13 | #endif 14 | 15 | int main(){ 16 | int failcode = 0; 17 | int failed; 18 | #ifndef T1 19 | failed = 0; 20 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 21 | failed = failed + test1(); 22 | } 23 | if (failed != 0){ 24 | failcode = failcode + (1 << 0); 25 | } 26 | #endif 27 | return failcode; 28 | } 29 | -------------------------------------------------------------------------------- /Tests/acc_get_num_devices.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:runtime,devonly,internal-control-values,syntactic,V:1.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | 7 | if(acc_get_device_type() != acc_device_none && acc_get_num_devices(acc_get_device_type()) == 0){ //Can't have zero of current device type 8 | err += 1; 9 | } 10 | 11 | return err; 12 | } 13 | #endif 14 | 15 | int main(){ 16 | int failcode = 0; 17 | int failed; 18 | #ifndef T1 19 | failed = 0; 20 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 21 | failed = failed + test1(); 22 | } 23 | if (failed != 0){ 24 | failcode = failcode + (1 << 0); 25 | } 26 | #endif 27 | return failcode; 28 | } 29 | -------------------------------------------------------------------------------- /Tests/acc_get_property.F90: -------------------------------------------------------------------------------- 1 | #ifndef T1 2 | !T1:runtime,construct-independent,internal-control-values,nonvalidating,V:2.6-2.7 3 | LOGICAL FUNCTION test1() 4 | USE OPENACC 5 | IMPLICIT NONE 6 | INCLUDE "acc_testsuite.Fh" 7 | INTEGER :: output 8 | IF (acc_get_device_type() .ne. acc_device_none) THEN 9 | output = acc_get_property(acc_get_device_num(acc_get_device_type()), acc_get_device_type(), acc_property_memory) 10 | output = acc_get_property(acc_get_device_num(acc_get_device_type()), acc_get_device_type(), acc_property_free_memory) 11 | END IF 12 | test1 = .FALSE. 13 | END 14 | #endif 15 | 16 | 17 | PROGRAM main 18 | IMPLICIT NONE 19 | INTEGER :: failcode, testrun 20 | LOGICAL :: failed 21 | INCLUDE "acc_testsuite.Fh" 22 | !Conditionally define test functions 23 | #ifndef T1 24 | LOGICAL :: test1 25 | #endif 26 | failcode = 0 27 | failed = .FALSE. 28 | 29 | #ifndef T1 30 | DO testrun = 1, NUM_TEST_CALLS 31 | failed = failed .or. test1() 32 | END DO 33 | IF (failed) THEN 34 | failcode = failcode + 2 ** 0 35 | failed = .FALSE. 36 | END IF 37 | #endif 38 | CALL EXIT (failcode) 39 | END PROGRAM 40 | 41 | -------------------------------------------------------------------------------- /Tests/acc_hostptr.F90: -------------------------------------------------------------------------------- 1 | #ifndef T1 2 | !T1:runtime,data,V:3.3 3 | LOGICAL FUNCTION test1() 4 | USE OPENACC 5 | IMPLICIT NONE 6 | INCLUDE "acc_testsuite.Fh" 7 | REAL, DIMENSION(LOOPCOUNT) :: a !Data 8 | INTEGER :: err = 0 9 | 10 | CALL acc_create(a) 11 | 12 | IF (a /= acc_hostptr(a)) THEN 13 | err = err + 1 14 | END IF 15 | 16 | CALL acc_delete(a) 17 | 18 | IF (err .eq. 0) THEN 19 | test1 = .FALSE. 20 | ELSE 21 | test1 = .TRUE. 22 | END IF 23 | END 24 | #endif 25 | 26 | PROGRAM main 27 | IMPLICIT NONE 28 | INTEGER :: failcode, testrun 29 | LOGICAL :: failed 30 | INCLUDE "acc_testsuite.Fh" 31 | !Conditionally define test functions 32 | #ifndef T1 33 | LOGICAL :: test1 34 | #endif 35 | failcode = 0 36 | failed = .FALSE. 37 | 38 | #ifndef T1 39 | DO testrun = 1, NUM_TEST_CALLS 40 | failed = failed .or. test1() 41 | END DO 42 | IF (failed) THEN 43 | failcode = failcode + 2 ** 0 44 | failed = .FALSE. 45 | END IF 46 | #endif 47 | CALL EXIT (failcode) 48 | END PROGRAM 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /Tests/acc_hostptr.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:runtime,data,V:2.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | real_t *a = (real_t *)malloc(n * sizeof(real_t)); 7 | real_t *a_ptr; 8 | 9 | a_ptr = acc_create(a, n * sizeof(real_t)); 10 | 11 | if (a != acc_hostptr(acc_deviceptr(a))){ 12 | err += 1; 13 | } 14 | 15 | acc_delete(a, n * sizeof(real_t)); 16 | 17 | return err; 18 | } 19 | #endif 20 | 21 | int main(){ 22 | int failcode = 0; 23 | int failed; 24 | #ifndef T1 25 | failed = 0; 26 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 27 | failed = failed + test1(); 28 | } 29 | if (failed != 0){ 30 | failcode = failcode + (1 << 0); 31 | } 32 | #endif 33 | return failcode; 34 | } 35 | -------------------------------------------------------------------------------- /Tests/acc_hostptr.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:runtime,data,V:2.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | real_t *a = new real_t[n]; 7 | real_t *a_ptr; 8 | 9 | a_ptr = reinterpret_cast(acc_create(a, n * sizeof(real_t))); 10 | 11 | if (a != acc_hostptr(acc_deviceptr(a))){ 12 | err += 1; 13 | } 14 | 15 | acc_delete(a, n * sizeof(real_t)); 16 | 17 | return err; 18 | } 19 | #endif 20 | 21 | int main(){ 22 | int failcode = 0; 23 | int failed; 24 | #ifndef T1 25 | failed = 0; 26 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 27 | failed = failed + test1(); 28 | } 29 | if (failed != 0){ 30 | failcode = failcode + (1 << 0); 31 | } 32 | #endif 33 | return failcode; 34 | } 35 | -------------------------------------------------------------------------------- /Tests/acc_init.F90: -------------------------------------------------------------------------------- 1 | #ifndef T1 2 | !T1:runtime,construct-independent,internal-control-values,init,nonvalidating,V:1.0-2.7 3 | LOGICAL FUNCTION test1() 4 | USE OPENACC 5 | IMPLICIT NONE 6 | INCLUDE "acc_testsuite.Fh" 7 | IF (acc_get_device_type() .ne. acc_device_none) THEN 8 | CALL acc_init(acc_get_device_type()) 9 | END IF 10 | 11 | test1 = .FALSE. 12 | END 13 | #endif 14 | 15 | 16 | PROGRAM main 17 | IMPLICIT NONE 18 | INTEGER :: failcode, testrun 19 | LOGICAL :: failed 20 | INCLUDE "acc_testsuite.Fh" 21 | !Conditionally define test functions 22 | #ifndef T1 23 | LOGICAL :: test1 24 | #endif 25 | failcode = 0 26 | failed = .FALSE. 27 | 28 | #ifndef T1 29 | DO testrun = 1, NUM_TEST_CALLS 30 | failed = failed .or. test1() 31 | END DO 32 | IF (failed) THEN 33 | failcode = failcode + 2 ** 0 34 | failed = .FALSE. 35 | END IF 36 | #endif 37 | CALL EXIT (failcode) 38 | END PROGRAM 39 | 40 | -------------------------------------------------------------------------------- /Tests/acc_init.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:runtime,init,syntactic,V:2.5-2.7 4 | int test1(){ 5 | int err = 0; 6 | 7 | if (acc_get_device_type() != acc_device_none){ 8 | acc_init(acc_get_device_type()); 9 | } 10 | 11 | return err; 12 | } 13 | #endif 14 | 15 | int main(){ 16 | int failcode = 0; 17 | int failed; 18 | #ifndef T1 19 | failed = 0; 20 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 21 | failed = failed + test1(); 22 | } 23 | if (failed != 0){ 24 | failcode = failcode + (1 << 0); 25 | } 26 | #endif 27 | return failcode; 28 | } 29 | -------------------------------------------------------------------------------- /Tests/acc_init.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:runtime,init,syntactic,V:2.5-2.7 4 | int test1(){ 5 | int err = 0; 6 | 7 | if (acc_get_device_type() != acc_device_none){ 8 | acc_init(acc_get_device_type()); 9 | } 10 | 11 | return err; 12 | } 13 | #endif 14 | 15 | int main(){ 16 | int failcode = 0; 17 | int failed; 18 | #ifndef T1 19 | failed = 0; 20 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 21 | failed = failed + test1(); 22 | } 23 | if (failed != 0){ 24 | failcode = failcode + (1 << 0); 25 | } 26 | #endif 27 | return failcode; 28 | } 29 | -------------------------------------------------------------------------------- /Tests/acc_init_device.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:routine,init,runtime,syntactic,V:3.2-3.3 4 | int test1(){ 5 | int err = 0; 6 | 7 | if (acc_get_device_type() != acc_device_none){ 8 | acc_init_device(1, acc_get_device_type()); 9 | } 10 | 11 | return err; 12 | } 13 | #endif 14 | 15 | int main(){ 16 | int failcode = 0; 17 | int failed; 18 | #ifndef T1 19 | failed = 0; 20 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 21 | failed = failed + test1(); 22 | } 23 | if (failed != 0){ 24 | failcode = failcode + (1 << 0); 25 | } 26 | #endif 27 | return failcode; 28 | } 29 | 30 | -------------------------------------------------------------------------------- /Tests/acc_is_present.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:runtime,data,executable-data,devonly,V:2.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | real_t *a = (real_t *)malloc(n * sizeof(real_t)); 7 | int *devtest = (int *)malloc(sizeof(int)); 8 | 9 | devtest[0] = 1; 10 | #pragma acc enter data copyin(devtest[0:1]) 11 | #pragma acc parallel present(devtest[0:1]) 12 | { 13 | devtest[0] = 0; 14 | } 15 | 16 | #pragma acc enter data create(a[0:n]) 17 | if (acc_is_present(a, n * sizeof(real_t)) == 0){ 18 | err += 1; 19 | } 20 | #pragma acc exit data delete(a[0:n]) 21 | 22 | if (devtest[0] == 1){ 23 | if (acc_is_present(a, n * sizeof(real_t)) != 0){ 24 | err += 1; 25 | } 26 | } 27 | 28 | return err; 29 | } 30 | #endif 31 | 32 | int main(){ 33 | int failcode = 0; 34 | int failed; 35 | #ifndef T1 36 | failed = 0; 37 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 38 | failed = failed + test1(); 39 | } 40 | if (failed != 0){ 41 | failcode = failcode + (1 << 0); 42 | } 43 | #endif 44 | return failcode; 45 | } 46 | -------------------------------------------------------------------------------- /Tests/acc_is_present.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:runtime,data,executable-data,devonly,V:2.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | real_t *a = new real_t[n]; 7 | int *devtest = (int *)malloc(sizeof(int)); 8 | 9 | devtest[0] = 1; 10 | #pragma acc enter data copyin(devtest[0:1]) 11 | #pragma acc parallel present(devtest[0:1]) 12 | { 13 | devtest[0] = 0; 14 | } 15 | 16 | #pragma acc enter data create(a[0:n]) 17 | if (acc_is_present(a, n * sizeof(real_t)) == 0){ 18 | err += 1; 19 | } 20 | #pragma acc exit data delete(a[0:n]) 21 | 22 | if (devtest[0] == 1){ 23 | if (acc_is_present(a, n * sizeof(real_t)) != 0){ 24 | err += 1; 25 | } 26 | } 27 | 28 | return err; 29 | } 30 | #endif 31 | 32 | int main(){ 33 | int failcode = 0; 34 | int failed; 35 | #ifndef T1 36 | failed = 0; 37 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 38 | failed = failed + test1(); 39 | } 40 | if (failed != 0){ 41 | failcode = failcode + (1 << 0); 42 | } 43 | #endif 44 | return failcode; 45 | } 46 | -------------------------------------------------------------------------------- /Tests/acc_malloc.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:runtime,data,executable-data,V:1.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | size_t initial_memory = acc_get_property(acc_get_device_num(acc_get_device_type()), acc_get_device_type(), acc_property_free_memory); 7 | int *a = (int *)acc_malloc(n * sizeof(int)); 8 | 9 | if (initial_memory == 0){ 10 | return err; 11 | } 12 | size_t final_memory = acc_get_property(acc_get_device_num(acc_get_device_type()), acc_get_device_type(), acc_property_free_memory); 13 | if (final_memory + n * sizeof(int) > initial_memory){ 14 | err += 1; 15 | } 16 | 17 | return err; 18 | } 19 | #endif 20 | 21 | int main(){ 22 | int failcode = 0; 23 | int failed; 24 | #ifndef T1 25 | failed = 0; 26 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 27 | failed = failed + test1(); 28 | } 29 | if (failed != 0){ 30 | failcode = failcode + (1 << 0); 31 | } 32 | #endif 33 | return failcode; 34 | } 35 | -------------------------------------------------------------------------------- /Tests/acc_malloc.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:runtime,data,executable-data,V:1.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | size_t initial_memory = acc_get_property(acc_get_device_num(acc_get_device_type()), acc_get_device_type(), acc_property_free_memory); 7 | int *a = (int *)acc_malloc(n * sizeof(int)); 8 | 9 | if (initial_memory == 0){ 10 | return err; 11 | } 12 | size_t final_memory = acc_get_property(acc_get_device_num(acc_get_device_type()), acc_get_device_type(), acc_property_free_memory); 13 | if (final_memory + n * sizeof(int) > initial_memory){ 14 | err += 1; 15 | } 16 | 17 | return err; 18 | } 19 | #endif 20 | 21 | int main(){ 22 | int failcode = 0; 23 | int failed; 24 | #ifndef T1 25 | failed = 0; 26 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 27 | failed = failed + test1(); 28 | } 29 | if (failed != 0){ 30 | failcode = failcode + (1 << 0); 31 | } 32 | #endif 33 | return failcode; 34 | } 35 | -------------------------------------------------------------------------------- /Tests/acc_on_device.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:runtime,construct-independent,V:1.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | int device_type = acc_get_device_type(); 7 | 8 | if (device_type != acc_device_none){ 9 | #pragma acc data copy(err) 10 | { 11 | #pragma acc parallel 12 | { 13 | if (acc_on_device(device_type) == 0){ 14 | err += 1; 15 | } 16 | } 17 | } 18 | } 19 | else{ 20 | #pragma acc parallel 21 | { 22 | if (acc_on_device(acc_device_host) == 0){ 23 | err += 1; 24 | } 25 | } 26 | } 27 | 28 | return err; 29 | } 30 | #endif 31 | 32 | int main(){ 33 | int failcode = 0; 34 | int failed; 35 | #ifndef T1 36 | failed = 0; 37 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 38 | failed = failed + test1(); 39 | } 40 | if (failed != 0){ 41 | failcode = failcode + (1 << 0); 42 | } 43 | #endif 44 | return failcode; 45 | } 46 | -------------------------------------------------------------------------------- /Tests/acc_on_device.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:runtime,construct-independent,V:1.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | acc_device_t device_type = acc_get_device_type(); 7 | 8 | if (device_type != acc_device_none){ 9 | #pragma acc data copy(err) 10 | { 11 | #pragma acc parallel 12 | { 13 | if (acc_on_device(device_type) == 0){ 14 | err += 1; 15 | } 16 | } 17 | } 18 | } 19 | else{ 20 | #pragma acc parallel 21 | { 22 | if (acc_on_device(acc_device_host) == 0){ 23 | err += 1; 24 | } 25 | } 26 | } 27 | 28 | return err; 29 | } 30 | #endif 31 | 32 | int main(){ 33 | int failcode = 0; 34 | int failed; 35 | #ifndef T1 36 | failed = 0; 37 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 38 | failed = failed + test1(); 39 | } 40 | if (failed != 0){ 41 | failcode = failcode + (1 << 0); 42 | } 43 | #endif 44 | return failcode; 45 | } 46 | -------------------------------------------------------------------------------- /Tests/acc_set_device_type.F90: -------------------------------------------------------------------------------- 1 | #ifndef T1 2 | !T1:runtime,construct-independent,internal-control-values,set,V:1.0-2.7 3 | LOGICAL FUNCTION test1() 4 | USE OPENACC 5 | IMPLICIT NONE 6 | INCLUDE "acc_testsuite.Fh" 7 | INTEGER :: errors = 0 8 | INTEGER :: device_type 9 | 10 | device_type = acc_get_device_type() 11 | CALL acc_set_device_type(device_type) 12 | IF (acc_get_device_type() .ne. device_type) THEN 13 | errors = errors + 1 14 | END IF 15 | 16 | IF (errors .eq. 0) THEN 17 | test1 = .FALSE. 18 | ELSE 19 | test1 = .TRUE. 20 | END IF 21 | END 22 | #endif 23 | 24 | 25 | PROGRAM main 26 | IMPLICIT NONE 27 | INTEGER :: failcode, testrun 28 | LOGICAL :: failed 29 | INCLUDE "acc_testsuite.Fh" 30 | !Conditionally define test functions 31 | #ifndef T1 32 | LOGICAL :: test1 33 | #endif 34 | failcode = 0 35 | failed = .FALSE. 36 | 37 | #ifndef T1 38 | DO testrun = 1, NUM_TEST_CALLS 39 | failed = failed .or. test1() 40 | END DO 41 | IF (failed) THEN 42 | failcode = failcode + 2 ** 0 43 | failed = .FALSE. 44 | END IF 45 | #endif 46 | CALL EXIT (failcode) 47 | END PROGRAM 48 | 49 | -------------------------------------------------------------------------------- /Tests/acc_set_device_type.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:runtime,internal-control-values,syntactic,V:2.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | 7 | int device_type = acc_get_device_type(); 8 | 9 | acc_set_device_type(device_type); 10 | if (acc_get_device_type() != device_type){ 11 | err += 1; 12 | } 13 | 14 | return err; 15 | } 16 | #endif 17 | 18 | int main(){ 19 | int failcode = 0; 20 | int failed; 21 | #ifndef T1 22 | failed = 0; 23 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 24 | failed = failed + test1(); 25 | } 26 | if (failed != 0){ 27 | failcode = failcode + (1 << 0); 28 | } 29 | #endif 30 | return failcode; 31 | } 32 | -------------------------------------------------------------------------------- /Tests/acc_set_device_type.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:runtime,internal-control-values,syntactic,V:2.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | 7 | acc_device_t device_type = acc_get_device_type(); 8 | 9 | acc_set_device_type(device_type); 10 | if (acc_get_device_type() != device_type){ 11 | err += 1; 12 | } 13 | 14 | return err; 15 | } 16 | #endif 17 | 18 | int main(){ 19 | int failcode = 0; 20 | int failed; 21 | #ifndef T1 22 | failed = 0; 23 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 24 | failed = failed + test1(); 25 | } 26 | if (failed != 0){ 27 | failcode = failcode + (1 << 0); 28 | } 29 | #endif 30 | return failcode; 31 | } 32 | -------------------------------------------------------------------------------- /Tests/acc_shutdown.F90: -------------------------------------------------------------------------------- 1 | #ifndef T1 2 | !T1:runtime,construct-independent,internal-control-values,shutdown,nonvalidating,V:1.0-2.7 3 | LOGICAL FUNCTION test1() 4 | USE OPENACC 5 | IMPLICIT NONE 6 | INCLUDE "acc_testsuite.Fh" 7 | IF (acc_get_device_type() .ne. acc_device_none) THEN 8 | CALL acc_shutdown(acc_get_device_type()) 9 | END IF 10 | 11 | test1 = .FALSE. 12 | END 13 | #endif 14 | 15 | 16 | PROGRAM main 17 | IMPLICIT NONE 18 | INTEGER :: failcode, testrun 19 | LOGICAL :: failed 20 | INCLUDE "acc_testsuite.Fh" 21 | !Conditionally define test functions 22 | #ifndef T1 23 | LOGICAL :: test1 24 | #endif 25 | failcode = 0 26 | failed = .FALSE. 27 | 28 | #ifndef T1 29 | DO testrun = 1, NUM_TEST_CALLS 30 | failed = failed .or. test1() 31 | END DO 32 | IF (failed) THEN 33 | failcode = failcode + 2 ** 0 34 | failed = .FALSE. 35 | END IF 36 | #endif 37 | CALL EXIT (failcode) 38 | END PROGRAM -------------------------------------------------------------------------------- /Tests/acc_shutdown.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:runtime,devonly,shutdown,V:2.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | 7 | if (acc_get_device_type() != acc_device_none){ 8 | acc_shutdown(acc_get_device_type()); 9 | } 10 | 11 | return err; 12 | } 13 | #endif 14 | 15 | int main(){ 16 | int failcode = 0; 17 | int failed; 18 | #ifndef T1 19 | failed = 0; 20 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 21 | failed = failed + test1(); 22 | } 23 | if (failed != 0){ 24 | failcode = failcode + (1 << 0); 25 | } 26 | #endif 27 | return failcode; 28 | } 29 | -------------------------------------------------------------------------------- /Tests/acc_shutdown.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:runtime,devonly,shutdown,V:2.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | 7 | if (acc_get_device_type() != acc_device_none){ 8 | acc_shutdown(acc_get_device_type()); 9 | } 10 | 11 | return err; 12 | } 13 | #endif 14 | 15 | int main(){ 16 | int failcode = 0; 17 | int failed; 18 | #ifndef T1 19 | failed = 0; 20 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 21 | failed = failed + test1(); 22 | } 23 | if (failed != 0){ 24 | failcode = failcode + (1 << 0); 25 | } 26 | #endif 27 | return failcode; 28 | } 29 | -------------------------------------------------------------------------------- /Tests/acc_shutdown_device.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:routine,shutdown,runtime,syntactic,V:3.2-3.3 4 | int test1(){ 5 | int err = 0; 6 | 7 | if (acc_get_device_type() != acc_device_none){ 8 | acc_shutdown_device(1, acc_get_device_type()); 9 | } 10 | 11 | return err; 12 | } 13 | #endif 14 | 15 | int main(){ 16 | int failcode = 0; 17 | int failed; 18 | #ifndef T1 19 | failed = 0; 20 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 21 | failed = failed + test1(); 22 | } 23 | if (failed != 0){ 24 | failcode = failcode + (1 << 0); 25 | } 26 | #endif 27 | return failcode; 28 | } 29 | 30 | -------------------------------------------------------------------------------- /Tests/acc_testsuite.Fh: -------------------------------------------------------------------------------- 1 | integer, parameter :: SMALL_LOOPCOUNT = 100 2 | integer, parameter :: LOOPCOUNT = 1000 3 | integer, parameter :: ARRAYSIZE = 1000 4 | integer, parameter :: ARRAYSIZE_NEW = 1024 5 | integer, parameter :: ARRAYSIZE_SMALL = 10 6 | integer, parameter :: NUM_TEST_CALLS = 1 7 | integer, parameter :: n = 1 8 | integer, dimension(33) :: SEEDDIM = 0 9 | real, parameter :: PRECISION = 1.e-2 10 | -------------------------------------------------------------------------------- /Tests/data_copy_no_lower_bound.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:data,data-region,construct-independent,V:1.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = (real_t *)malloc(n * sizeof(real_t)); 8 | real_t * b = (real_t *)malloc(n * sizeof(real_t)); 9 | real_t * c = (real_t *)malloc(n * sizeof(real_t)); 10 | 11 | for (int x = 0; x < n; ++x){ 12 | a[x] = rand() / (real_t)(RAND_MAX / 10); 13 | b[x] = rand() / (real_t)(RAND_MAX / 10); 14 | c[x] = 0.0; 15 | } 16 | 17 | #pragma acc data copyin(a[0:n], b[0:n]) copy(c[:n]) 18 | { 19 | #pragma acc parallel 20 | { 21 | #pragma acc loop 22 | for (int x = 0; x < n; ++x){ 23 | c[x] += a[x] + b[x]; 24 | } 25 | } 26 | } 27 | 28 | for (int x = 0; x < n; ++x){ 29 | if (fabs(c[x] - (a[x] + b[x])) > PRECISION){ 30 | err += 1; 31 | } 32 | } 33 | 34 | return err; 35 | } 36 | #endif 37 | 38 | int main(){ 39 | int failcode = 0; 40 | int failed; 41 | #ifndef T1 42 | failed = 0; 43 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 44 | failed = failed + test1(); 45 | } 46 | if (failed != 0){ 47 | failcode = failcode + (1 << 0); 48 | } 49 | #endif 50 | return failcode; 51 | } 52 | -------------------------------------------------------------------------------- /Tests/data_copy_no_lower_bound.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:data,data-region,construct-independent,V:1.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = new real_t[n]; 8 | real_t * b = new real_t[n]; 9 | real_t * c = new real_t[n]; 10 | 11 | for (int x = 0; x < n; ++x){ 12 | a[x] = rand() / (real_t)(RAND_MAX / 10); 13 | b[x] = rand() / (real_t)(RAND_MAX / 10); 14 | c[x] = 0.0; 15 | } 16 | 17 | #pragma acc data copyin(a[0:n], b[0:n]) copy(c[:n]) 18 | { 19 | #pragma acc parallel 20 | { 21 | #pragma acc loop 22 | for (int x = 0; x < n; ++x){ 23 | c[x] += a[x] + b[x]; 24 | } 25 | } 26 | } 27 | 28 | for (int x = 0; x < n; ++x){ 29 | if (fabs(c[x] - (a[x] + b[x])) > PRECISION){ 30 | err += 1; 31 | } 32 | } 33 | 34 | return err; 35 | } 36 | #endif 37 | 38 | int main(){ 39 | int failcode = 0; 40 | int failed; 41 | #ifndef T1 42 | failed = 0; 43 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 44 | failed = failed + test1(); 45 | } 46 | if (failed != 0){ 47 | failcode = failcode + (1 << 0); 48 | } 49 | #endif 50 | return failcode; 51 | } 52 | -------------------------------------------------------------------------------- /Tests/data_copyin_no_lower_bound.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:data,data-region,construct-independent,V:1.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = (real_t *)malloc(n * sizeof(real_t)); 8 | real_t * b = (real_t *)malloc(n * sizeof(real_t)); 9 | real_t * c = (real_t *)malloc(n * sizeof(real_t)); 10 | 11 | for (int x = 0; x < n; ++x){ 12 | a[x] = rand() / (real_t)(RAND_MAX / 10); 13 | b[x] = rand() / (real_t)(RAND_MAX / 10); 14 | c[x] = 0.0; 15 | } 16 | 17 | #pragma acc data copyin(a[:n], b[:n]) copyout(c[0:n]) 18 | { 19 | #pragma acc parallel 20 | { 21 | #pragma acc loop 22 | for (int x = 0; x < n; ++x){ 23 | c[x] = a[x] + b[x]; 24 | } 25 | } 26 | } 27 | 28 | for (int x = 0; x < n; ++x){ 29 | if (fabs(c[x] - (a[x] + b[x])) > PRECISION){ 30 | err += 1; 31 | } 32 | } 33 | 34 | return err; 35 | } 36 | #endif 37 | 38 | int main(){ 39 | int failcode = 0; 40 | int failed; 41 | #ifndef T1 42 | failed = 0; 43 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 44 | failed = failed + test1(); 45 | } 46 | if (failed != 0){ 47 | failcode = failcode + (1 << 0); 48 | } 49 | #endif 50 | return failcode; 51 | } 52 | -------------------------------------------------------------------------------- /Tests/data_copyin_no_lower_bound.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:data,data-region,construct-independent,V:1.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = new real_t[n]; 8 | real_t * b = new real_t[n]; 9 | real_t * c = new real_t[n]; 10 | 11 | for (int x = 0; x < n; ++x){ 12 | a[x] = rand() / (real_t)(RAND_MAX / 10); 13 | b[x] = rand() / (real_t)(RAND_MAX / 10); 14 | c[x] = 0.0; 15 | } 16 | 17 | #pragma acc data copyin(a[:n], b[:n]) copyout(c[0:n]) 18 | { 19 | #pragma acc parallel 20 | { 21 | #pragma acc loop 22 | for (int x = 0; x < n; ++x){ 23 | c[x] = a[x] + b[x]; 24 | } 25 | } 26 | } 27 | 28 | for (int x = 0; x < n; ++x){ 29 | if (fabs(c[x] - (a[x] + b[x])) > PRECISION){ 30 | err += 1; 31 | } 32 | } 33 | 34 | return err; 35 | } 36 | #endif 37 | 38 | int main(){ 39 | int failcode = 0; 40 | int failed; 41 | #ifndef T1 42 | failed = 0; 43 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 44 | failed = failed + test1(); 45 | } 46 | if (failed != 0){ 47 | failcode = failcode + (1 << 0); 48 | } 49 | #endif 50 | return failcode; 51 | } 52 | -------------------------------------------------------------------------------- /Tests/data_copyout_no_lower_bound.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:data,data-region,construct-independent,V:1.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = (real_t *)malloc(n * sizeof(real_t)); 8 | real_t * b = (real_t *)malloc(n * sizeof(real_t)); 9 | real_t * c = (real_t *)malloc(n * sizeof(real_t)); 10 | 11 | for (int x = 0; x < n; ++x){ 12 | a[x] = rand() / (real_t)(RAND_MAX / 10); 13 | b[x] = rand() / (real_t)(RAND_MAX / 10); 14 | c[x] = 0.0; 15 | } 16 | 17 | #pragma acc data copyin(a[0:n], b[0:n]) copyout(c[:n]) 18 | { 19 | #pragma acc parallel 20 | { 21 | #pragma acc loop 22 | for (int x = 0; x < n; ++x){ 23 | c[x] = a[x] + b[x]; 24 | } 25 | } 26 | } 27 | 28 | for (int x = 0; x < n; ++x){ 29 | if (fabs(c[x] - (a[x] + b[x])) > PRECISION){ 30 | err += 1; 31 | } 32 | } 33 | 34 | return err; 35 | } 36 | #endif 37 | 38 | int main(){ 39 | int failcode = 0; 40 | int failed; 41 | #ifndef T1 42 | failed = 0; 43 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 44 | failed = failed + test1(); 45 | } 46 | if (failed != 0){ 47 | failcode = failcode + (1 << 0); 48 | } 49 | #endif 50 | return failcode; 51 | } 52 | -------------------------------------------------------------------------------- /Tests/data_copyout_no_lower_bound.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:data,data-region,construct-independent,V:1.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = new real_t[n]; 8 | real_t * b = new real_t[n]; 9 | real_t * c = new real_t[n]; 10 | 11 | for (int x = 0; x < n; ++x){ 12 | a[x] = rand() / (real_t)(RAND_MAX / 10); 13 | b[x] = rand() / (real_t)(RAND_MAX / 10); 14 | c[x] = 0.0; 15 | } 16 | 17 | #pragma acc data copyin(a[0:n], b[0:n]) copyout(c[:n]) 18 | { 19 | #pragma acc parallel 20 | { 21 | #pragma acc loop 22 | for (int x = 0; x < n; ++x){ 23 | c[x] = a[x] + b[x]; 24 | } 25 | } 26 | } 27 | 28 | for (int x = 0; x < n; ++x){ 29 | if (fabs(c[x] - (a[x] + b[x])) > PRECISION){ 30 | err += 1; 31 | } 32 | } 33 | 34 | return err; 35 | } 36 | #endif 37 | 38 | int main(){ 39 | int failcode = 0; 40 | int failed; 41 | #ifndef T1 42 | failed = 0; 43 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 44 | failed = failed + test1(); 45 | } 46 | if (failed != 0){ 47 | failcode = failcode + (1 << 0); 48 | } 49 | #endif 50 | return failcode; 51 | } 52 | -------------------------------------------------------------------------------- /Tests/data_copyout_zero.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:data,executable-data,data-region,V:3.0-3.2 4 | int test1(){ 5 | 6 | int err = 0; 7 | srand(SEED); 8 | 9 | real_t * a = (real_t *)malloc(n * sizeof(real_t)); 10 | real_t * b = (real_t *)malloc(n * sizeof(real_t)); 11 | 12 | for (int x = 0; x < n; ++x){ 13 | a[x] = rand() / (real_t)(RAND_MAX / 10); 14 | b[x] = 0; 15 | } 16 | 17 | #pragma acc data copyin(a[0:n]) copyout(zero: b[0:n]) 18 | { 19 | #pragma acc parallel 20 | { 21 | #pragma acc loop 22 | { 23 | for (int x = 0; x < n; ++x){ 24 | b[x] += a[x]; 25 | } 26 | } 27 | } 28 | } 29 | 30 | for (int x = 0; x < n; ++x){ 31 | if(fabs(a[x] - b[x]) > PRECISION){ 32 | err += 1; 33 | break; 34 | } 35 | } 36 | 37 | return err; 38 | } 39 | #endif 40 | 41 | int main(){ 42 | int failcode = 0; 43 | int failed; 44 | #ifndef T1 45 | failed = 0; 46 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 47 | failed = failed + test1(); 48 | } 49 | if (failed != 0){ 50 | failcode = failcode + (1 << 0); 51 | } 52 | #endif 53 | return failcode; 54 | } 55 | -------------------------------------------------------------------------------- /Tests/data_copyout_zero.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:data,executable-data,data-region,V:3.0-3.2 4 | int test1(){ 5 | 6 | int err = 0; 7 | srand(SEED); 8 | 9 | real_t * a = new real_t[n]; 10 | real_t * b = new real_t[n]; 11 | 12 | for (int x = 0; x < n; ++x){ 13 | a[x] = rand() / (real_t)(RAND_MAX / 10); 14 | b[x] = 0; 15 | } 16 | 17 | #pragma acc data copyin(a[0:n]) copyout(zero: b[0:n]) 18 | { 19 | #pragma acc parallel 20 | { 21 | #pragma acc loop 22 | { 23 | for (int x = 0; x < n; ++x){ 24 | b[x] += a[x]; 25 | } 26 | } 27 | } 28 | } 29 | 30 | for (int x = 0; x < n; ++x){ 31 | if(fabs(a[x] - b[x]) > PRECISION){ 32 | err += 1; 33 | break; 34 | } 35 | } 36 | 37 | return err; 38 | } 39 | #endif 40 | 41 | int main(){ 42 | int failcode = 0; 43 | int failed; 44 | #ifndef T1 45 | failed = 0; 46 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 47 | failed = failed + test1(); 48 | } 49 | if (failed != 0){ 50 | failcode = failcode + (1 << 0); 51 | } 52 | #endif 53 | return failcode; 54 | } 55 | -------------------------------------------------------------------------------- /Tests/data_create_zero.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:data,executable-data,data-region,V:3.0-3.2 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | 8 | real_t * a = (real_t *)malloc(n * sizeof(real_t)); 9 | real_t * b = (real_t *)malloc(n * sizeof(real_t)); 10 | 11 | for (int x = 0; x < n; ++x){ 12 | a[x] = rand() / (real_t)(RAND_MAX / 10); 13 | b[x] = 1; 14 | } 15 | 16 | #pragma acc data copyin(a[0:n]) create(zero: b[0:n]) copyout(b[0:n]) 17 | { 18 | #pragma acc parallel 19 | { 20 | #pragma acc loop 21 | { 22 | for (int x = 0; x < n; ++x){ 23 | b[x] += a[x]; 24 | } 25 | } 26 | } 27 | } 28 | 29 | for (int x = 0; x < n; ++x){ 30 | if (fabs(a[x] - b[x]) > PRECISION){ 31 | err = 1; 32 | } 33 | } 34 | 35 | return err; 36 | } 37 | #endif 38 | 39 | int main(){ 40 | int failcode = 0; 41 | int testrun; 42 | int failed; 43 | #ifndef T1 44 | failed = 0; 45 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 46 | failed = failed + test1(); 47 | } 48 | if (failed != 0){ 49 | failcode = failcode + (1 << 0); 50 | } 51 | #endif 52 | return failcode; 53 | } -------------------------------------------------------------------------------- /Tests/data_create_zero.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:data,executable-data,data-region,V:3.0-3.2 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | 8 | real_t * a = new real_t[n]; 9 | real_t * b = new real_t[n]; 10 | 11 | for (int x = 0; x < n; ++x){ 12 | a[x] = rand() / (real_t)(RAND_MAX / 10); 13 | b[x] = 1; 14 | } 15 | 16 | #pragma acc data copyin(a[0:n]) create(zero: b[0:n]) copyout(b[0:n]) 17 | { 18 | #pragma acc parallel 19 | { 20 | #pragma acc loop 21 | { 22 | for (int x = 0; x < n; ++x){ 23 | b[x] += a[x]; 24 | } 25 | } 26 | } 27 | } 28 | 29 | for (int x = 0; x < n; ++x){ 30 | if (fabs(a[x] - b[x]) > PRECISION){ 31 | err = 1; 32 | } 33 | } 34 | 35 | return err; 36 | } 37 | #endif 38 | 39 | int main(){ 40 | int failcode = 0; 41 | int testrun; 42 | int failed; 43 | #ifndef T1 44 | failed = 0; 45 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 46 | failed = failed + test1(); 47 | } 48 | if (failed != 0){ 49 | failcode = failcode + (1 << 0); 50 | } 51 | #endif 52 | return failcode; 53 | } -------------------------------------------------------------------------------- /Tests/data_present_no_lower_bound.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:data,data-region,construct-independent,V:1.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = new real_t[n]; 8 | real_t * b = new real_t[n]; 9 | real_t * c = new real_t[n]; 10 | 11 | for (int x = 0; x < n; ++x){ 12 | a[x] = rand() / (real_t)(RAND_MAX / 10); 13 | b[x] = rand() / (real_t)(RAND_MAX / 10); 14 | c[x] = 0.0; 15 | } 16 | 17 | #pragma acc enter data copyin(c[0:n]) 18 | #pragma acc data copyin(a[0:n], b[0:n]) present(c[:n]) 19 | { 20 | #pragma acc parallel 21 | { 22 | #pragma acc loop 23 | for (int x = 0; x < n; ++x){ 24 | c[x] += a[x] + b[x]; 25 | } 26 | } 27 | } 28 | #pragma acc exit data copyout(c[0:n]) 29 | 30 | for (int x = 0; x < n; ++x){ 31 | if (fabs(c[x] - (a[x] + b[x])) > PRECISION){ 32 | err += 1; 33 | } 34 | } 35 | 36 | return err; 37 | } 38 | #endif 39 | 40 | int main(){ 41 | int failcode = 0; 42 | int failed; 43 | #ifndef T1 44 | failed = 0; 45 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 46 | failed = failed + test1(); 47 | } 48 | if (failed != 0){ 49 | failcode = failcode + (1 << 0); 50 | } 51 | #endif 52 | return failcode; 53 | } 54 | -------------------------------------------------------------------------------- /Tests/data_with_changing_subscript.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:data,data-region,construct-independent,V:2.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | int length = n; 8 | real_t * a = new real_t[n]; 9 | real_t * b = new real_t[n]; 10 | real_t * c = new real_t[n]; 11 | 12 | for (int x = 0; x < n; ++x){ 13 | a[x] = rand() / (real_t)(RAND_MAX / 10); 14 | b[x] = rand() / (real_t)(RAND_MAX / 10); 15 | c[x] = 0.0; 16 | } 17 | 18 | #pragma acc data copyin(a[0:length], b[0:length]) copyout(c[0:length]) 19 | { 20 | #pragma acc parallel 21 | { 22 | #pragma acc loop 23 | for (int x = 0; x < length; ++x){ 24 | c[x] = a[x] + b[x]; 25 | } 26 | } 27 | length = 1; 28 | } 29 | 30 | for (int x = 0; x < n; ++x){ 31 | if (fabs(c[x] - (a[x] + b[x])) > PRECISION){ 32 | err += 1; 33 | } 34 | } 35 | 36 | return err; 37 | } 38 | #endif 39 | 40 | int main(){ 41 | int failcode = 0; 42 | int failed; 43 | #ifndef T1 44 | failed = 0; 45 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 46 | failed = failed + test1(); 47 | } 48 | if (failed != 0){ 49 | failcode = failcode + (1 << 0); 50 | } 51 | #endif 52 | return failcode; 53 | } 54 | -------------------------------------------------------------------------------- /Tests/data_with_structs.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | typedef struct multi_item { 3 | real_t a; 4 | real_t b; 5 | real_t c; 6 | } multi_item; 7 | 8 | #ifndef T1 9 | //T1:data,data-region,construct-independent,V:1.0-2.7 10 | int test1(){ 11 | int err = 0; 12 | srand(SEED); 13 | multi_item * a = new multi_item[n]; 14 | 15 | for (int x = 0; x < n; ++x){ 16 | a[x].a = rand() / (real_t)(RAND_MAX / 10); 17 | a[x].b = rand() / (real_t)(RAND_MAX / 10); 18 | a[x].c = rand() / (real_t)(RAND_MAX / 10); 19 | } 20 | 21 | #pragma acc data copy(a[0:n]) 22 | { 23 | #pragma acc parallel 24 | { 25 | #pragma acc loop 26 | for (int x = 0; x < n; ++x){ 27 | a[x].c = a[x].a + a[x].b; 28 | } 29 | } 30 | } 31 | 32 | for (int x = 0; x < n; ++x){ 33 | if (fabs(a[x].c - (a[x].a + a[x].b)) > PRECISION){ 34 | err += 1; 35 | } 36 | } 37 | 38 | return err; 39 | } 40 | #endif 41 | 42 | int main(){ 43 | int failcode = 0; 44 | int failed; 45 | #ifndef T1 46 | failed = 0; 47 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 48 | failed = failed + test1(); 49 | } 50 | if (failed != 0){ 51 | failcode = failcode + (1 << 0); 52 | } 53 | #endif 54 | return failcode; 55 | } 56 | -------------------------------------------------------------------------------- /Tests/declare_copyin_mod.F90: -------------------------------------------------------------------------------- 1 | MODULE DECLARE_COPYIN_MOD 2 | INTEGER,DIMENSION(10):: fixed_size_array 3 | !$acc declare copyin(fixed_size_array) 4 | END MODULE DECLARE_COPYIN_MOD 5 | 6 | -------------------------------------------------------------------------------- /Tests/enter_data_copyin_no_lower_bound.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:data,executable-data,syntactic,V:2.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = new real_t[n]; 8 | real_t * b = new real_t[n]; 9 | real_t * c = new real_t[n]; 10 | 11 | for (int x = 0; x < n; ++x){ 12 | a[x] = rand() / (real_t)(RAND_MAX / 10); 13 | b[x] = rand() / (real_t)(RAND_MAX / 10); 14 | c[x] = 0.0; 15 | } 16 | 17 | #pragma acc enter data copyin(a[:n], b[:n]) create(c[0:n]) 18 | #pragma acc parallel present(a[0:n], b[0:n], c[0:n]) 19 | { 20 | #pragma acc loop 21 | for (int x = 0; x < n; ++x){ 22 | c[x] = a[x] + b[x]; 23 | } 24 | } 25 | #pragma acc exit data copyout(c[0:n]) delete(a[0:n], b[0:n]) 26 | 27 | for (int x = 0; x < n; ++x){ 28 | if (fabs(c[x] - (a[x] + b[x])) > PRECISION) { 29 | err += 1; 30 | } 31 | } 32 | 33 | return err; 34 | } 35 | #endif 36 | 37 | int main(){ 38 | int failcode = 0; 39 | int failed; 40 | #ifndef T1 41 | failed = 0; 42 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 43 | failed = failed + test1(); 44 | } 45 | if (failed != 0){ 46 | failcode = failcode + (1 << 0); 47 | } 48 | #endif 49 | return failcode; 50 | } 51 | -------------------------------------------------------------------------------- /Tests/enter_data_create_no_lower_bound.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:data,executable-data,syntactic,construct-independent,V:2.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = new real_t[n]; 8 | real_t * b = new real_t[n]; 9 | real_t * c = new real_t[n]; 10 | 11 | for (int x = 0; x < n; ++x){ 12 | a[x] = rand() / (real_t)(RAND_MAX / 10); 13 | b[x] = rand() / (real_t)(RAND_MAX / 10); 14 | c[x] = 0.0; 15 | } 16 | 17 | #pragma acc enter data copyin(a[0:n], b[0:n]) create(c[:n]) 18 | #pragma acc parallel present(a[0:n], b[0:n], c[0:n]) 19 | { 20 | #pragma acc loop 21 | for (int x = 0; x < n; ++x){ 22 | c[x] = a[x] + b[x]; 23 | } 24 | } 25 | #pragma acc exit data delete(a[0:n], b[0:n]) copyout(c[0:n]) 26 | 27 | for (int x = 0; x < n; ++x){ 28 | if (fabs(c[x] - (a[x] + b[x])) > PRECISION){ 29 | err += 1; 30 | } 31 | } 32 | 33 | return err; 34 | } 35 | #endif 36 | 37 | int main(){ 38 | int failcode = 0; 39 | int failed; 40 | #ifndef T1 41 | failed = 0; 42 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 43 | failed = failed + test1(); 44 | } 45 | if (failed != 0){ 46 | failcode = failcode + (1 << 0); 47 | } 48 | #endif 49 | return failcode; 50 | } 51 | -------------------------------------------------------------------------------- /Tests/exit_data_copyout_no_lower_bound.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:data,executable-data,syntactic,construct-independent,V:2.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = new real_t[n]; 8 | real_t * b = new real_t[n]; 9 | real_t * c = new real_t[n]; 10 | 11 | for (int x = 0; x < n; ++x){ 12 | a[x] = rand() / (real_t)(RAND_MAX / 10); 13 | b[x] = rand() / (real_t)(RAND_MAX / 10); 14 | c[x] = 0.0; 15 | } 16 | 17 | #pragma acc enter data copyin(a[0:n], b[0:n]) create(c[0:n]) 18 | #pragma acc parallel present(a[0:n], b[0:n], c[0:n]) 19 | { 20 | #pragma acc loop 21 | for (int x = 0; x < n; ++x){ 22 | c[x] = a[x] + b[x]; 23 | } 24 | } 25 | #pragma acc exit data delete(a[0:n], b[0:n]) copyout(c[:n]) 26 | 27 | for (int x = 0; x < n; ++x){ 28 | if (fabs(c[x] - (a[x] + b[x])) > PRECISION) { 29 | err += 1; 30 | } 31 | } 32 | 33 | return err; 34 | } 35 | #endif 36 | 37 | int main(){ 38 | int failcode = 0; 39 | int failed; 40 | #ifndef T1 41 | failed = 0; 42 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 43 | failed = failed + test1(); 44 | } 45 | if (failed != 0){ 46 | failcode = failcode + (1 << 0); 47 | } 48 | #endif 49 | return failcode; 50 | } 51 | -------------------------------------------------------------------------------- /Tests/exit_data_delete_no_lower_bound.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:data,executable-data,construct-independent,syntactic,V:2.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = (real_t *)malloc(n * sizeof(real_t)); 8 | real_t * b = (real_t *)malloc(n * sizeof(real_t)); 9 | real_t * c = (real_t *)malloc(n * sizeof(real_t)); 10 | 11 | for (int x = 0; x < n; ++x){ 12 | a[x] = rand() / (real_t)(RAND_MAX / 10); 13 | b[x] = rand() / (real_t)(RAND_MAX / 10); 14 | c[x] = 0.0; 15 | } 16 | 17 | #pragma acc enter data copyin(a[0:n], b[0:n]) create(c[0:n]) 18 | #pragma acc parallel present(a[0:n], b[0:n], c[0:n]) 19 | { 20 | #pragma acc loop 21 | for (int x = 0; x < n; ++x){ 22 | c[x] = a[x] + b[x]; 23 | } 24 | } 25 | #pragma acc exit data delete(a[:n], b[:n]) copyout(c[0:n]) 26 | 27 | return err; 28 | } 29 | #endif 30 | 31 | int main(){ 32 | int failcode = 0; 33 | int failed; 34 | #ifndef T1 35 | failed = 0; 36 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 37 | failed = failed + test1(); 38 | } 39 | if (failed != 0){ 40 | failcode = failcode + (1 << 0); 41 | } 42 | #endif 43 | return failcode; 44 | } 45 | -------------------------------------------------------------------------------- /Tests/exit_data_delete_no_lower_bound.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:data,executable-data,construct-independent,syntactic,V:2.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = new real_t[n]; 8 | real_t * b = new real_t[n]; 9 | real_t * c = new real_t[n]; 10 | 11 | for (int x = 0; x < n; ++x){ 12 | a[x] = rand() / (real_t)(RAND_MAX / 10); 13 | b[x] = rand() / (real_t)(RAND_MAX / 10); 14 | c[x] = 0.0; 15 | } 16 | 17 | #pragma acc enter data copyin(a[0:n], b[0:n]) create(c[0:n]) 18 | #pragma acc parallel present(a[0:n], b[0:n], c[0:n]) 19 | { 20 | #pragma acc loop 21 | for (int x = 0; x < n; ++x){ 22 | c[x] = a[x] + b[x]; 23 | } 24 | } 25 | #pragma acc exit data delete(a[:n], b[:n]) copyout(c[0:n]) 26 | 27 | return err; 28 | } 29 | #endif 30 | 31 | int main(){ 32 | int failcode = 0; 33 | int failed; 34 | #ifndef T1 35 | failed = 0; 36 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 37 | failed = failed + test1(); 38 | } 39 | if (failed != 0){ 40 | failcode = failcode + (1 << 0); 41 | } 42 | #endif 43 | return failcode; 44 | } 45 | -------------------------------------------------------------------------------- /Tests/init.F90: -------------------------------------------------------------------------------- 1 | #ifndef T1 2 | !T1:construct-independent,init,nonvalidating,V:2.5-2.7 3 | LOGICAL FUNCTION test1() 4 | USE OPENACC 5 | IMPLICIT NONE 6 | INCLUDE "acc_testsuite.Fh" 7 | INTEGER :: errors = 0 8 | 9 | !$acc init 10 | 11 | IF (errors .eq. 0) THEN 12 | test1 = .FALSE. 13 | ELSE 14 | test1 = .TRUE. 15 | END IF 16 | END 17 | #endif 18 | 19 | PROGRAM main 20 | IMPLICIT NONE 21 | INTEGER :: failcode, testrun 22 | LOGICAL :: failed 23 | INCLUDE "acc_testsuite.Fh" 24 | #ifndef T1 25 | LOGICAL :: test1 26 | #endif 27 | failed = .FALSE. 28 | failcode = 0 29 | #ifndef T1 30 | DO testrun = 1, NUM_TEST_CALLS 31 | failed = failed .or. test1() 32 | END DO 33 | IF (failed) THEN 34 | failcode = failcode + 2 ** 0 35 | failed = .FALSE. 36 | END IF 37 | #endif 38 | CALL EXIT (failcode) 39 | END PROGRAM 40 | -------------------------------------------------------------------------------- /Tests/init.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:init,V:2.5-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | 8 | #pragma acc init 9 | 10 | return err; 11 | } 12 | #endif 13 | 14 | int main(){ 15 | int failcode = 0; 16 | int failed; 17 | #ifndef T1 18 | failed = 0; 19 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 20 | failed = failed + test1(); 21 | } 22 | if (failed != 0){ 23 | failcode = failcode + (1 << 0); 24 | } 25 | #endif 26 | return failcode; 27 | } 28 | -------------------------------------------------------------------------------- /Tests/init.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:init,V:2.5-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | 8 | #pragma acc init 9 | 10 | return err; 11 | } 12 | #endif 13 | 14 | int main(){ 15 | int failcode = 0; 16 | int failed; 17 | #ifndef T1 18 | failed = 0; 19 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 20 | failed = failed + test1(); 21 | } 22 | if (failed != 0){ 23 | failcode = failcode + (1 << 0); 24 | } 25 | #endif 26 | return failcode; 27 | } 28 | -------------------------------------------------------------------------------- /Tests/init_device_num.F90: -------------------------------------------------------------------------------- 1 | #ifndef T1 2 | !T1:runtime,construct-independent,internal-control-values,init,nonvalidating,V:2.5-2.7 3 | LOGICAL FUNCTION test1() 4 | USE OPENACC 5 | IMPLICIT NONE 6 | INCLUDE "acc_testsuite.Fh" 7 | INTEGER :: device_num 8 | INTEGER :: device_type 9 | INTEGER :: errors = 0 10 | 11 | device_num = acc_get_device_num(acc_get_device_type()) 12 | !$acc init device_num(device_num) 13 | 14 | IF (errors .eq. 0) THEN 15 | test1 = .FALSE. 16 | ELSE 17 | test1 = .TRUE. 18 | END IF 19 | END 20 | #endif 21 | 22 | PROGRAM main 23 | IMPLICIT NONE 24 | INTEGER :: failcode, testrun 25 | LOGICAL :: failed 26 | INCLUDE "acc_testsuite.Fh" 27 | #ifndef T1 28 | LOGICAL :: test1 29 | #endif 30 | failed = .FALSE. 31 | failcode = 0 32 | #ifndef T1 33 | DO testrun = 1, NUM_TEST_CALLS 34 | failed = failed .or. test1() 35 | END DO 36 | IF (failed) THEN 37 | failcode = failcode + 2 ** 0 38 | failed = .FALSE. 39 | END IF 40 | #endif 41 | CALL EXIT (failcode) 42 | END PROGRAM 43 | -------------------------------------------------------------------------------- /Tests/init_device_num.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:init,runtime,V:2.5-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | int device_num = acc_get_device_num(acc_get_device_type()); 8 | 9 | #pragma acc init device_num(device_num) 10 | 11 | return err; 12 | } 13 | #endif 14 | 15 | int main(){ 16 | int failcode = 0; 17 | int failed; 18 | #ifndef T1 19 | failed = 0; 20 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 21 | failed = failed + test1(); 22 | } 23 | if (failed != 0){ 24 | failcode = failcode + (1 << 0); 25 | } 26 | #endif 27 | return failcode; 28 | } 29 | -------------------------------------------------------------------------------- /Tests/init_device_num.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:init,runtime,V:2.5-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | int device_num = acc_get_device_num(acc_get_device_type()); 8 | 9 | #pragma acc init device_num(device_num) 10 | 11 | return err; 12 | } 13 | #endif 14 | 15 | int main(){ 16 | int failcode = 0; 17 | int failed; 18 | #ifndef T1 19 | failed = 0; 20 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 21 | failed = failed + test1(); 22 | } 23 | if (failed != 0){ 24 | failcode = failcode + (1 << 0); 25 | } 26 | #endif 27 | return failcode; 28 | } 29 | -------------------------------------------------------------------------------- /Tests/init_device_type.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:init,runtime,V:2.5-3.2 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | 8 | #pragma acc init device_type(host) 9 | 10 | return err; 11 | } 12 | #endif 13 | #ifndef T2 14 | //T2:init,runtime,V:2.5-3.2 15 | int test2(){ 16 | int err = 0; 17 | srand(SEED); 18 | 19 | #pragma acc init device_type(multicore) 20 | 21 | return err; 22 | } 23 | #endif 24 | #ifndef T3 25 | //T3:init,runtime,V:2.5-3.2 26 | int test3(){ 27 | int err = 0; 28 | srand(SEED); 29 | 30 | #pragma acc init device_type(default) 31 | 32 | return err; 33 | } 34 | #endif 35 | 36 | int main(){ 37 | int failcode = 0; 38 | int failed; 39 | #ifndef T1 40 | failed = 0; 41 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 42 | failed += test1(); 43 | } 44 | if (failed){ 45 | failcode += (1 << 0); 46 | } 47 | #endif 48 | #ifndef T2 49 | failed = 0; 50 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 51 | failed += test2(); 52 | } 53 | if (failed){ 54 | failcode += (1 << 1); 55 | } 56 | #endif 57 | #ifndef T3 58 | failed = 0; 59 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 60 | failed += test3(); 61 | } 62 | if (failed){ 63 | failcode += (1 << 2); 64 | } 65 | #endif 66 | return failcode; 67 | } 68 | -------------------------------------------------------------------------------- /Tests/init_device_type.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:init,runtime,V:2.5-3.2 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | 8 | #pragma acc init device_type(host) 9 | 10 | return err; 11 | } 12 | #endif 13 | #ifndef T2 14 | //T2:init,runtime,V:2.5-3.2 15 | int test2(){ 16 | int err = 0; 17 | srand(SEED); 18 | 19 | #pragma acc init device_type(multicore) 20 | 21 | return err; 22 | } 23 | #endif 24 | #ifndef T3 25 | //T3:init,runtime,V:2.5-3.2 26 | int test3(){ 27 | int err = 0; 28 | srand(SEED); 29 | 30 | #pragma acc init device_type(default) 31 | 32 | return err; 33 | } 34 | #endif 35 | 36 | int main(){ 37 | int failcode = 0; 38 | int failed; 39 | #ifndef T1 40 | failed = 0; 41 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 42 | failed += test1(); 43 | } 44 | if (failed){ 45 | failcode += (1 << 0); 46 | } 47 | #endif 48 | #ifndef T2 49 | failed = 0; 50 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 51 | failed += test2(); 52 | } 53 | if (failed){ 54 | failcode += (1 << 1); 55 | } 56 | #endif 57 | #ifndef T3 58 | failed = 0; 59 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 60 | failed += test3(); 61 | } 62 | if (failed){ 63 | failcode += (1 << 2); 64 | } 65 | #endif 66 | return failcode; 67 | } 68 | -------------------------------------------------------------------------------- /Tests/init_device_type_num_nvidia.F90: -------------------------------------------------------------------------------- 1 | #ifndef T1 2 | !T1:runtime,construct-independent,internal-control-values,init,nonvalidating,V:2.5-2.7 3 | LOGICAL FUNCTION test1() 4 | USE OPENACC 5 | IMPLICIT NONE 6 | INCLUDE "acc_testsuite.Fh" 7 | INTEGER :: device_num 8 | INTEGER :: device_type 9 | INTEGER :: errors = 0 10 | 11 | device_type = acc_get_device_type() 12 | device_num = acc_get_device_num(device_type) 13 | !$acc init device_type(nvidia) device_num(device_num) 14 | 15 | IF (errors .eq. 0) THEN 16 | test1 = .FALSE. 17 | ELSE 18 | test1 = .TRUE. 19 | END IF 20 | END 21 | #endif 22 | 23 | PROGRAM init_device_type_num 24 | IMPLICIT NONE 25 | INTEGER :: failcode, testrun 26 | LOGICAL :: failed 27 | INCLUDE "acc_testsuite.Fh" 28 | #ifndef T1 29 | LOGICAL :: test1 30 | #endif 31 | failed = .FALSE. 32 | failcode = 0 33 | #ifndef T1 34 | DO testrun = 1, NUM_TEST_CALLS 35 | failed = failed .or. test1() 36 | END DO 37 | IF (failed) THEN 38 | failcode = failcode + 2 ** 0 39 | failed = .FALSE. 40 | END IF 41 | #endif 42 | CALL EXIT (failcode) 43 | END PROGRAM 44 | -------------------------------------------------------------------------------- /Tests/init_device_type_num_nvidia.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:init,runtime,V:2.5-3.2 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | int device_num = acc_get_device_num(acc_get_device_type()); 8 | 9 | #pragma acc init device_type(nvidia) device_num(device_num) 10 | 11 | return err; 12 | } 13 | #endif 14 | 15 | int main(){ 16 | int failcode = 0; 17 | int failed; 18 | #ifndef T1 19 | failed = 0; 20 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 21 | failed += test1(); 22 | } 23 | if (failed){ 24 | failcode += (1 << 0); 25 | } 26 | #endif 27 | return failcode; 28 | } 29 | -------------------------------------------------------------------------------- /Tests/init_device_type_num_nvidia.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:init,runtime,V:2.5-3.2 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | int device_num = acc_get_device_num(acc_get_device_type()); 8 | 9 | #pragma acc init device_type(nvidia) device_num(device_num) 10 | 11 | return err; 12 | } 13 | #endif 14 | 15 | int main(){ 16 | int failcode = 0; 17 | int failed; 18 | #ifndef T1 19 | failed = 0; 20 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 21 | failed += test1(); 22 | } 23 | if (failed){ 24 | failcode += (1 << 0); 25 | } 26 | #endif 27 | return failcode; 28 | } 29 | -------------------------------------------------------------------------------- /Tests/init_device_type_nvidia.F90: -------------------------------------------------------------------------------- 1 | #ifndef T1 2 | !T1:runtime,construct-independent,internal-control-values,init,nonvalidating,V:2.5-3.2 3 | LOGICAL FUNCTION test1() 4 | USE OPENACC 5 | IMPLICIT NONE 6 | INCLUDE "acc_testsuite.Fh" 7 | INTEGER :: errors = 0 8 | 9 | !$acc init device_type(nvidia) 10 | 11 | IF (errors .eq. 0) THEN 12 | test1 = .FALSE. 13 | ELSE 14 | test1 = .TRUE. 15 | END IF 16 | END 17 | #endif 18 | 19 | PROGRAM init_device_type 20 | IMPLICIT NONE 21 | INTEGER :: failcode, testrun 22 | LOGICAL :: failed 23 | INCLUDE "acc_testsuite.Fh" 24 | #ifndef T1 25 | LOGICAL :: test1 26 | #endif 27 | failed = .FALSE. 28 | failcode = 0 29 | #ifndef T1 30 | DO testrun = 1, NUM_TEST_CALLS 31 | failed = failed .or. test1() 32 | END DO 33 | IF (failed) THEN 34 | failcode = failcode + 2 ** 0 35 | failed = .FALSE. 36 | END IF 37 | #endif 38 | CALL EXIT (failcode) 39 | END PROGRAM 40 | -------------------------------------------------------------------------------- /Tests/init_device_type_nvidia.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:init,runtime,V:2.5-3.2 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | 8 | #pragma acc init device_type(nvidia) 9 | 10 | return err; 11 | } 12 | #endif 13 | 14 | int main(){ 15 | int failcode = 0; 16 | int failed; 17 | #ifndef T1 18 | failed = 0; 19 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 20 | failed += test1(); 21 | } 22 | if (failed){ 23 | failcode += (1 << 0); 24 | } 25 | #endif 26 | return failcode; 27 | } 28 | -------------------------------------------------------------------------------- /Tests/init_device_type_nvidia.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:init,runtime,V:2.5-3.2 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | 8 | #pragma acc init device_type(nvidia) 9 | 10 | return err; 11 | } 12 | #endif 13 | 14 | int main(){ 15 | int failcode = 0; 16 | int failed; 17 | #ifndef T1 18 | failed = 0; 19 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 20 | failed += test1(); 21 | } 22 | if (failed){ 23 | failcode += (1 << 0); 24 | } 25 | #endif 26 | return failcode; 27 | } 28 | -------------------------------------------------------------------------------- /Tests/init_if.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:init,if,V:2.7-3.0 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | 8 | int device_num = acc_get_device_num(acc_get_device_type()); 9 | 10 | #pragma acc init if(device_num == device_num) 11 | 12 | return err; 13 | } 14 | #endif 15 | 16 | #ifndef T2 17 | //T2:,V:2.7-3.0 18 | int test2(){ 19 | int err = 0; 20 | srand(SEED); 21 | 22 | int device_num = acc_get_device_num(acc_get_device_type()); 23 | 24 | #pragma acc init if(device_num != device_num) 25 | 26 | return err; 27 | } 28 | #endif 29 | 30 | int main(){ 31 | int failcode = 0; 32 | int failed; 33 | #ifndef T1 34 | failed = 0; 35 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 36 | failed = failed + test1(); 37 | } 38 | if (failed != 0){ 39 | failcode = failcode + (1 << 0); 40 | } 41 | #endif 42 | #ifndef T2 43 | failed = 0; 44 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 45 | failed = failed + test2(); 46 | } 47 | if (failed != 0){ 48 | failcode = failcode + (1 << 1); 49 | } 50 | #endif 51 | return failcode; 52 | } 53 | -------------------------------------------------------------------------------- /Tests/init_if.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | 3 | #ifndef T1 4 | //T1:init,if,V:2.7-3.0 5 | int test1(){ 6 | int err = 0; 7 | srand(SEED); 8 | 9 | int device_num = acc_get_device_num(acc_get_device_type()); 10 | 11 | #pragma acc init if(device_num == device_num) 12 | 13 | return err; 14 | } 15 | #endif 16 | 17 | #ifndef T2 18 | //T2:init,if,V:2.7-3.0 19 | int test2(){ 20 | int err = 0; 21 | srand(SEED); 22 | 23 | int device_num = acc_get_device_num(acc_get_device_type()); 24 | 25 | #pragma acc init if(device_num != device_num) 26 | 27 | return err; 28 | } 29 | #endif 30 | 31 | int main(){ 32 | int failcode = 0; 33 | int failed; 34 | #ifndef T1 35 | failed = 0; 36 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 37 | failed = failed + test1(); 38 | } 39 | if (failed != 0){ 40 | failcode = failcode + (1 << 0); 41 | } 42 | #endif 43 | #ifndef T2 44 | failed = 0; 45 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 46 | failed = failed + test2(); 47 | } 48 | if (failed != 0){ 49 | failcode = failcode + (1 << 1); 50 | } 51 | #endif 52 | return failcode; 53 | } 54 | -------------------------------------------------------------------------------- /Tests/kernels_create_zero.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:kernels,data,data-region,V:3.0-3.2 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = (real_t *)malloc(n * sizeof(real_t)); 8 | real_t * b = (real_t *)malloc(n * sizeof(real_t)); 9 | 10 | for (int x = 0; x < n; ++x){ 11 | a[x] = rand() / (real_t)(RAND_MAX / 10); 12 | b[x] = 0.0; 13 | } 14 | 15 | #pragma acc data copyin(a[0:n]) copyout(b[0:n]) 16 | { 17 | #pragma acc kernels create(zero: b[0:n]) 18 | { 19 | #pragma acc loop 20 | for (int x = 0; x < n; ++x){ 21 | b[x] += a[x]; 22 | } 23 | } 24 | } 25 | 26 | for (int x = 0; x < n; ++x){ 27 | if (fabs(a[x] - b[x]) > PRECISION){ 28 | err += 1; 29 | } 30 | } 31 | 32 | return err; 33 | } 34 | #endif 35 | 36 | int main(){ 37 | int failcode = 0; 38 | int failed; 39 | #ifndef T1 40 | failed = 0; 41 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 42 | failed = failed + test1(); 43 | } 44 | if (failed != 0){ 45 | failcode = failcode + (1 << 0); 46 | } 47 | #endif 48 | return failcode; 49 | } 50 | -------------------------------------------------------------------------------- /Tests/kernels_create_zero.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:kernels,data,data-region,V:3.0-3.2 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = new real_t[n]; 8 | real_t * b = new real_t[n]; 9 | 10 | for (int x = 0; x < n; ++x){ 11 | a[x] = rand() / (real_t)(RAND_MAX / 10); 12 | b[x] = 0.0; 13 | } 14 | 15 | #pragma acc data copyin(a[0:n]) copyout(b[0:n]) 16 | { 17 | #pragma acc kernels create(zero: b[0:n]) 18 | { 19 | #pragma acc loop 20 | for (int x = 0; x < n; ++x){ 21 | b[x] += a[x]; 22 | } 23 | } 24 | } 25 | 26 | for (int x = 0; x < n; ++x){ 27 | if (fabs(a[x] - b[x]) > PRECISION){ 28 | err += 1; 29 | } 30 | } 31 | 32 | return err; 33 | } 34 | #endif 35 | 36 | int main(){ 37 | int failcode = 0; 38 | int failed; 39 | #ifndef T1 40 | failed = 0; 41 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 42 | failed = failed + test1(); 43 | } 44 | if (failed != 0){ 45 | failcode = failcode + (1 << 0); 46 | } 47 | #endif 48 | return failcode; 49 | } 50 | -------------------------------------------------------------------------------- /Tests/kernels_default_present.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:kernels,data,data-region,default,V:2.5-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = (real_t *)malloc(n * sizeof(real_t)); 8 | real_t * b = (real_t *)malloc(n * sizeof(real_t)); 9 | 10 | for (int x = 0; x < n; ++x){ 11 | a[x] = rand() / (real_t)(RAND_MAX / 10); 12 | b[x] = 0; 13 | } 14 | 15 | #pragma acc enter data copyin(a[0:n]), create(b[0:n]) 16 | #pragma acc kernels default(present) 17 | { 18 | #pragma acc loop 19 | for (int x = 0; x < n; ++x){ 20 | b[x] = a[x]; 21 | } 22 | } 23 | #pragma acc exit data delete(a[0:n]), copyout(b[0:n]) 24 | 25 | for (int x = 0; x < n; ++x){ 26 | if (fabs(a[x] - b[x]) > PRECISION){ 27 | err += 1; 28 | } 29 | } 30 | 31 | return err; 32 | } 33 | #endif 34 | 35 | int main(){ 36 | int failcode = 0; 37 | int failed; 38 | #ifndef T1 39 | failed = 0; 40 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 41 | failed = failed + test1(); 42 | } 43 | if (failed != 0){ 44 | failcode = failcode + (1 << 0); 45 | } 46 | #endif 47 | return failcode; 48 | } 49 | -------------------------------------------------------------------------------- /Tests/kernels_default_present.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:kernels,data,data-region,default,V:2.5-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = new real_t[n]; 8 | real_t * b = new real_t[n]; 9 | 10 | for (int x = 0; x < n; ++x){ 11 | a[x] = rand() / (real_t)(RAND_MAX / 10); 12 | b[x] = 0; 13 | } 14 | 15 | #pragma acc enter data copyin(a[0:n]), create(b[0:n]) 16 | #pragma acc kernels default(present) 17 | { 18 | #pragma acc loop 19 | for (int x = 0; x < n; ++x){ 20 | b[x] = a[x]; 21 | } 22 | } 23 | #pragma acc exit data delete(a[0:n]), copyout(b[0:n]) 24 | 25 | for (int x = 0; x < n; ++x){ 26 | if (fabs(a[x] - b[x]) > PRECISION){ 27 | err += 1; 28 | } 29 | } 30 | 31 | return err; 32 | } 33 | #endif 34 | 35 | int main(){ 36 | int failcode = 0; 37 | int failed; 38 | #ifndef T1 39 | failed = 0; 40 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 41 | failed = failed + test1(); 42 | } 43 | if (failed != 0){ 44 | failcode = failcode + (1 << 0); 45 | } 46 | #endif 47 | return failcode; 48 | } 49 | -------------------------------------------------------------------------------- /Tests/kernels_loop_independent.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:kernels,loop,combined-constructs,V:1.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = (real_t *)malloc(n * sizeof(real_t)); 8 | real_t * b = (real_t *)malloc(n * sizeof(real_t)); 9 | 10 | for (int x = 0; x < n; ++x){ 11 | a[x] = rand() / (real_t)(RAND_MAX / 10); 12 | b[x] = rand() / (real_t)(RAND_MAX / 10); 13 | } 14 | 15 | #pragma acc data copyin(a[0:n]) copyout(b[0:n]) 16 | { 17 | #pragma acc kernels loop independent 18 | for (int x = 0; x < n; ++x){ 19 | b[x] = a[x]; 20 | } 21 | } 22 | 23 | for (int x = 0; x < n; ++x){ 24 | if (fabs(a[x] - b[x]) > PRECISION){ 25 | err += 1; 26 | } 27 | } 28 | 29 | return err; 30 | } 31 | #endif 32 | 33 | int main(){ 34 | int failcode = 0; 35 | int failed; 36 | #ifndef T1 37 | failed = 0; 38 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 39 | failed = failed + test1(); 40 | } 41 | if (failed != 0){ 42 | failcode = failcode + (1 << 0); 43 | } 44 | #endif 45 | return failcode; 46 | } 47 | -------------------------------------------------------------------------------- /Tests/kernels_loop_independent.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:kernels,loop,combined-constructs,V:1.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = new real_t[n]; 8 | real_t * b = new real_t[n]; 9 | 10 | for (int x = 0; x < n; ++x){ 11 | a[x] = rand() / (real_t)(RAND_MAX / 10); 12 | b[x] = rand() / (real_t)(RAND_MAX / 10); 13 | } 14 | 15 | #pragma acc data copyin(a[0:n]) copyout(b[0:n]) 16 | { 17 | #pragma acc kernels loop independent 18 | for (int x = 0; x < n; ++x){ 19 | b[x] = a[x]; 20 | } 21 | } 22 | 23 | for (int x = 0; x < n; ++x){ 24 | if (fabs(a[x] - b[x]) > PRECISION){ 25 | err += 1; 26 | } 27 | } 28 | 29 | return err; 30 | } 31 | #endif 32 | 33 | int main(){ 34 | int failcode = 0; 35 | int failed; 36 | #ifndef T1 37 | failed = 0; 38 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 39 | failed = failed + test1(); 40 | } 41 | if (failed != 0){ 42 | failcode = failcode + (1 << 0); 43 | } 44 | #endif 45 | return failcode; 46 | } 47 | -------------------------------------------------------------------------------- /Tests/kernels_loop_reduction_add_general.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:kernels,loop,reduction,combined-constructs,V:1.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = (real_t *)malloc(n * sizeof(real_t)); 8 | real_t * b = (real_t *)malloc(n * sizeof(real_t)); 9 | 10 | for (int x = 0; x < n; ++x){ 11 | a[x] = rand() / (real_t)(RAND_MAX / 10); 12 | b[x] = rand() / (real_t)(RAND_MAX / 10); 13 | } 14 | 15 | real_t total = 10; //Should be innitialized to 0 anyway. 16 | #pragma acc data copyin(a[0:n], b[0:n]) 17 | { 18 | #pragma acc kernels loop reduction(+:total) 19 | for (int x = 0; x < n; ++x){ 20 | total += a[x] + b[x]; 21 | } 22 | } 23 | for (int x = 0; x < n; ++x){ 24 | total -= a[x] + b[x]; 25 | } 26 | if (fabs(total - 10) > PRECISION * (2 * n - 1)){ 27 | err = 1; 28 | } 29 | 30 | return err; 31 | } 32 | #endif 33 | 34 | int main(){ 35 | int failcode = 0; 36 | int failed; 37 | #ifndef T1 38 | failed = 0; 39 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 40 | failed = failed + test1(); 41 | } 42 | if (failed != 0){ 43 | failcode = failcode + (1 << 0); 44 | } 45 | #endif 46 | return failcode; 47 | } 48 | -------------------------------------------------------------------------------- /Tests/kernels_loop_reduction_add_general.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:kernels,loop,reduction,combined-constructs,V:1.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = new real_t[n]; 8 | real_t * b = new real_t[n]; 9 | 10 | for (int x = 0; x < n; ++x){ 11 | a[x] = rand() / (real_t)(RAND_MAX / 10); 12 | b[x] = rand() / (real_t)(RAND_MAX / 10); 13 | } 14 | 15 | real_t total = 10; //Should be innitialized to 0 anyway. 16 | #pragma acc data copyin(a[0:n], b[0:n]) 17 | { 18 | #pragma acc kernels loop reduction(+:total) 19 | for (int x = 0; x < n; ++x){ 20 | total += a[x] + b[x]; 21 | } 22 | } 23 | for (int x = 0; x < n; ++x){ 24 | total -= a[x] + b[x]; 25 | } 26 | if (fabs(total - 10) > PRECISION * (2 * n - 1)){ 27 | err = 1; 28 | } 29 | 30 | return err; 31 | } 32 | #endif 33 | 34 | int main(){ 35 | int failcode = 0; 36 | int failed; 37 | #ifndef T1 38 | failed = 0; 39 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 40 | failed = failed + test1(); 41 | } 42 | if (failed != 0){ 43 | failcode = failcode + (1 << 0); 44 | } 45 | #endif 46 | return failcode; 47 | } 48 | -------------------------------------------------------------------------------- /Tests/kernels_loop_reduction_and_general.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:kernels,loop,reduction,combined-constructs,V:1.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | 8 | char * a = (char *)malloc(n * sizeof(char)); 9 | real_t false_margin = pow(exp(1), log(.5)/n); 10 | char result = 1; 11 | 12 | for (int x = 0; x < n; ++x){ 13 | if(rand() / (real_t)(RAND_MAX) < false_margin){ 14 | a[x] = 1; 15 | } 16 | else{ 17 | a[x] = 0; 18 | } 19 | } 20 | 21 | 22 | #pragma acc data copyin(a[0:n]) 23 | { 24 | #pragma acc kernels loop reduction(&&:result) 25 | for (int x = 0; x < n; ++x){ 26 | result = result && a[x]; 27 | } 28 | } 29 | 30 | char found = 0; 31 | for (int x = 0; x < n; ++x){ 32 | if (a[x] == 0){ 33 | found = 1; 34 | break; 35 | } 36 | } 37 | if (found == result){ 38 | err = 1; 39 | } 40 | 41 | return err; 42 | } 43 | #endif 44 | 45 | int main(){ 46 | int failcode = 0; 47 | int failed; 48 | #ifndef T1 49 | failed = 0; 50 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 51 | failed = failed + test1(); 52 | } 53 | if (failed != 0){ 54 | failcode = failcode + (1 << 0); 55 | } 56 | #endif 57 | return failcode; 58 | } 59 | -------------------------------------------------------------------------------- /Tests/kernels_loop_reduction_and_general.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:kernels,loop,reduction,combined-constructs,V:1.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | 8 | char * a = new char[n]; 9 | real_t false_margin = pow(exp(1), log(.5)/n); 10 | char result = 1; 11 | 12 | for (int x = 0; x < n; ++x){ 13 | if(rand() / (real_t)(RAND_MAX) < false_margin){ 14 | a[x] = 1; 15 | } 16 | else{ 17 | a[x] = 0; 18 | } 19 | } 20 | 21 | 22 | #pragma acc data copyin(a[0:n]) 23 | { 24 | #pragma acc kernels loop reduction(&&:result) 25 | for (int x = 0; x < n; ++x){ 26 | result = result && a[x]; 27 | } 28 | } 29 | 30 | char found = 0; 31 | for (int x = 0; x < n; ++x){ 32 | if (a[x] == 0){ 33 | found = 1; 34 | break; 35 | } 36 | } 37 | if (found == result){ 38 | err = 1; 39 | } 40 | 41 | return err; 42 | } 43 | #endif 44 | 45 | int main(){ 46 | int failcode = 0; 47 | int failed; 48 | #ifndef T1 49 | failed = 0; 50 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 51 | failed = failed + test1(); 52 | } 53 | if (failed != 0){ 54 | failcode = failcode + (1 << 0); 55 | } 56 | #endif 57 | return failcode; 58 | } 59 | -------------------------------------------------------------------------------- /Tests/kernels_loop_reduction_bitxor_general.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:kernels,loop,reduction,combined-constructs,V:1.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | unsigned int * a = (unsigned int *)malloc(n * sizeof(unsigned int)); 8 | unsigned int b = 0; 9 | 10 | for (int x = 0; x < n; ++x){ 11 | a[x] = (unsigned int) rand() / (real_t) (RAND_MAX / 2); 12 | } 13 | unsigned int host_b = a[0]; 14 | 15 | #pragma acc data copyin(a[0:n]) 16 | { 17 | #pragma acc kernels loop reduction(^:b) 18 | for (int x = 0; x < n; ++x){ 19 | b = b ^ a[x]; 20 | } 21 | } 22 | 23 | 24 | for (int x = 1; x < n; ++x){ 25 | host_b = host_b ^ a[x]; 26 | } 27 | if (b != host_b){ 28 | err = 1; 29 | } 30 | 31 | return err; 32 | } 33 | #endif 34 | 35 | int main(){ 36 | int failcode = 0; 37 | int failed; 38 | #ifndef T1 39 | failed = 0; 40 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 41 | failed = failed + test1(); 42 | } 43 | if (failed != 0){ 44 | failcode = failcode + (1 << 0); 45 | } 46 | #endif 47 | return failcode; 48 | } 49 | -------------------------------------------------------------------------------- /Tests/kernels_loop_reduction_bitxor_general.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:kernels,loop,reduction,combined-constructs,V:1.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | unsigned int * a = (unsigned int *)malloc(n * sizeof(unsigned int)); 8 | unsigned int b = 0; 9 | 10 | for (int x = 0; x < n; ++x){ 11 | a[x] = (unsigned int) rand() / (real_t) (RAND_MAX / 2); 12 | } 13 | unsigned int host_b = a[0]; 14 | 15 | #pragma acc data copyin(a[0:n]) 16 | { 17 | #pragma acc kernels loop reduction(^:b) 18 | for (int x = 0; x < n; ++x){ 19 | b = b ^ a[x]; 20 | } 21 | } 22 | 23 | 24 | for (int x = 1; x < n; ++x){ 25 | host_b = host_b ^ a[x]; 26 | } 27 | if (b != host_b){ 28 | err = 1; 29 | } 30 | 31 | return err; 32 | } 33 | #endif 34 | 35 | int main(){ 36 | int failcode = 0; 37 | int failed; 38 | #ifndef T1 39 | failed = 0; 40 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 41 | failed = failed + test1(); 42 | } 43 | if (failed != 0){ 44 | failcode = failcode + (1 << 0); 45 | } 46 | #endif 47 | return failcode; 48 | } 49 | -------------------------------------------------------------------------------- /Tests/kernels_loop_reduction_max_general.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:kernels,loop,reduction,combined-constructs,V:1.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = new real_t[n]; 8 | real_t * b = new real_t[n]; 9 | real_t max = 0.0; 10 | int found = 0; 11 | 12 | for (int x = 0; x < n; ++x){ 13 | a[x] = rand() / (real_t)(RAND_MAX/10); 14 | b[x] = rand() / (real_t)(RAND_MAX/10); 15 | } 16 | #pragma acc data copyin(a[0:n], b[0:n]) copy(max) 17 | { 18 | #pragma acc kernels loop reduction(max:max) 19 | for (int x = 0; x < n; ++x){ 20 | max = fmax(a[x] * b[x], max); 21 | } 22 | } 23 | 24 | for (int x = 0; x < n; ++x){ 25 | if (fabs(max - (a[x] * b[x] + PRECISION)) < 0){ 26 | err = 1; 27 | } 28 | if (fabs(max - (a[x] * b[x] - PRECISION)) > 0){ 29 | found = 1; 30 | } 31 | } 32 | if (found == 0){ 33 | err = 1; 34 | } 35 | 36 | return err; 37 | } 38 | #endif 39 | 40 | int main(){ 41 | int failcode = 0; 42 | int failed; 43 | #ifndef T1 44 | failed = 0; 45 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 46 | failed = failed + test1(); 47 | } 48 | if (failed != 0){ 49 | failcode = failcode + (1 << 0); 50 | } 51 | #endif 52 | return failcode; 53 | } 54 | -------------------------------------------------------------------------------- /Tests/kernels_loop_reduction_or_general.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:kernels,loop,reduction,combined-constructs,V:1.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | char * a = (char *)malloc(n * sizeof(char)); 8 | real_t false_margin = pow(exp(1), log(.5)/n); 9 | char result = 0; 10 | char found = 0; 11 | 12 | for (int x = 0; x < n; ++x){ 13 | if(a[x] = rand() / (real_t)(RAND_MAX) > false_margin){ 14 | a[x] = 1; 15 | } 16 | else{ 17 | a[x] = 0; 18 | } 19 | } 20 | 21 | 22 | #pragma acc data copyin(a[0:n]) 23 | { 24 | #pragma acc kernels loop reduction(||:result) 25 | for (int x = 0; x < n; ++x){ 26 | result = result || a[x]; 27 | } 28 | } 29 | 30 | for (int x = 0; x < n; ++x){ 31 | if (a[x] == 1){ 32 | found = 1; 33 | } 34 | } 35 | if (found != result){ 36 | err = 1; 37 | } 38 | 39 | return err; 40 | } 41 | #endif 42 | 43 | int main(){ 44 | int failcode = 0; 45 | int failed; 46 | #ifndef T1 47 | failed = 0; 48 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 49 | failed = failed + test1(); 50 | } 51 | if (failed != 0){ 52 | failcode = failcode + (1 << 0); 53 | } 54 | #endif 55 | return failcode; 56 | } 57 | -------------------------------------------------------------------------------- /Tests/kernels_loop_reduction_or_general.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:kernels,loop,reduction,combined-constructs,V:1.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | char * a = new char[n]; 8 | real_t false_margin = pow(exp(1), log(.5)/n); 9 | char result = 0; 10 | char found = 0; 11 | 12 | for (int x = 0; x < n; ++x){ 13 | if(a[x] = rand() / (real_t)(RAND_MAX) > false_margin){ 14 | a[x] = 1; 15 | } 16 | else{ 17 | a[x] = 0; 18 | } 19 | } 20 | 21 | 22 | #pragma acc data copyin(a[0:n]) 23 | { 24 | #pragma acc kernels loop reduction(||:result) 25 | for (int x = 0; x < n; ++x){ 26 | result = result || a[x]; 27 | } 28 | } 29 | 30 | for (int x = 0; x < n; ++x){ 31 | if (a[x] == 1){ 32 | found = 1; 33 | } 34 | } 35 | if (found != result){ 36 | err = 1; 37 | } 38 | 39 | return err; 40 | } 41 | #endif 42 | 43 | int main(){ 44 | int failcode = 0; 45 | int failed; 46 | #ifndef T1 47 | failed = 0; 48 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 49 | failed = failed + test1(); 50 | } 51 | if (failed != 0){ 52 | failcode = failcode + (1 << 0); 53 | } 54 | #endif 55 | return failcode; 56 | } 57 | -------------------------------------------------------------------------------- /Tests/kernels_loop_seq.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:kernels,loop,combined-constructs,V:1.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = (real_t *)malloc(n * sizeof(real_t)); 8 | real_t * b = (real_t *)malloc(n * sizeof(real_t)); 9 | real_t temp = 0.0; 10 | 11 | for (int x = 0; x < n; ++x){ 12 | a[x] = rand() / (real_t)(RAND_MAX / 10); 13 | b[x] = 0.0; 14 | } 15 | 16 | #pragma acc data copyin(a[0:n]) copy(b[0:n]) 17 | { 18 | #pragma acc kernels loop seq 19 | for (int x = 1; x < n; ++x){ 20 | b[x] = b[x-1] + a[x]; 21 | } 22 | } 23 | 24 | for (int x = 1; x < n; ++x){ 25 | temp += a[x]; 26 | if (fabs(b[x] - temp) > PRECISION){ 27 | err = 1; 28 | } 29 | } 30 | 31 | return err; 32 | } 33 | #endif 34 | 35 | int main(){ 36 | int failcode = 0; 37 | int failed; 38 | #ifndef T1 39 | failed = 0; 40 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 41 | failed = failed + test1(); 42 | } 43 | if (failed != 0){ 44 | failcode = failcode + (1 << 0); 45 | } 46 | #endif 47 | return failcode; 48 | } 49 | -------------------------------------------------------------------------------- /Tests/kernels_loop_seq.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:kernels,loop,combined-constructs,V:1.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = new real_t[n]; 8 | real_t * b = new real_t[n]; 9 | real_t temp = 0.0; 10 | 11 | for (int x = 0; x < n; ++x){ 12 | a[x] = rand() / (real_t)(RAND_MAX / 10); 13 | b[x] = 0.0; 14 | } 15 | 16 | #pragma acc data copyin(a[0:n]) copy(b[0:n]) 17 | { 18 | #pragma acc kernels loop seq 19 | for (int x = 1; x < n; ++x){ 20 | b[x] = b[x-1] + a[x]; 21 | } 22 | } 23 | 24 | for (int x = 1; x < n; ++x){ 25 | temp += a[x]; 26 | if (fabs(b[x] - temp) > PRECISION){ 27 | err = 1; 28 | } 29 | } 30 | 31 | return err; 32 | } 33 | #endif 34 | 35 | int main(){ 36 | int failcode = 0; 37 | int failed; 38 | #ifndef T1 39 | failed = 0; 40 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 41 | failed = failed + test1(); 42 | } 43 | if (failed != 0){ 44 | failcode = failcode + (1 << 0); 45 | } 46 | #endif 47 | return failcode; 48 | } 49 | -------------------------------------------------------------------------------- /Tests/kernels_num_gangs.F90: -------------------------------------------------------------------------------- 1 | #ifndef T1 2 | !T1:kernels,reduction,V:2.5-2.7 3 | LOGICAL FUNCTION test1() 4 | IMPLICIT NONE 5 | INCLUDE "acc_testsuite.Fh" 6 | INTEGER :: x !Iterators 7 | INTEGER :: results !Data 8 | INTEGER :: errors = 0 9 | 10 | results = 0 11 | 12 | !$acc kernels num_gangs(8) 13 | !$acc loop gang reduction(+:results) 14 | DO x = 1, LOOPCOUNT 15 | results = 1 16 | END DO 17 | !$acc end kernels 18 | 19 | IF (results .ne. 8) THEN 20 | errors = errors + 1 21 | END IF 22 | 23 | IF (errors .eq. 0) THEN 24 | test1 = .FALSE. 25 | ELSE 26 | test1 = .TRUE. 27 | END IF 28 | END 29 | #endif 30 | 31 | PROGRAM main 32 | IMPLICIT NONE 33 | INTEGER :: failcode, testrun 34 | LOGICAL :: failed 35 | INCLUDE "acc_testsuite.Fh" 36 | #ifndef T1 37 | LOGICAL :: test1 38 | #endif 39 | failed = .FALSE. 40 | failcode = 0 41 | #ifndef T1 42 | DO testrun = 1, NUM_TEST_CALLS 43 | failed = failed .or. test1() 44 | END DO 45 | IF (failed) THEN 46 | failcode = failcode + 2 ** 0 47 | failed = .FALSE. 48 | END IF 49 | #endif 50 | CALL EXIT (failcode) 51 | END PROGRAM 52 | -------------------------------------------------------------------------------- /Tests/kernels_num_gangs.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:kernels,loop,V:2.5-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * restrict a = (real_t *)malloc(n * sizeof(real_t)); 8 | real_t * restrict b = (real_t *)malloc(n * sizeof(real_t)); 9 | 10 | for (int x = 0; x < n; ++x){ 11 | a[x] = rand() / (real_t)(RAND_MAX / 10); 12 | b[x] = 0; 13 | } 14 | 15 | #pragma acc data copyin(a[0:n]) copyout(b[0:n]) 16 | { 17 | #pragma acc kernels loop num_gangs(16) 18 | for (int x = 0; x < n; ++x){ 19 | b[x] = a[x]; 20 | } 21 | } 22 | 23 | for (int x = 0; x < n; ++x){ 24 | if (fabs(a[x] - b[x]) > PRECISION){ 25 | err += 1; 26 | } 27 | } 28 | 29 | return err; 30 | } 31 | #endif 32 | 33 | int main(){ 34 | int failcode = 0; 35 | int failed; 36 | #ifndef T1 37 | failed = 0; 38 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 39 | failed = failed + test1(); 40 | } 41 | if (failed != 0){ 42 | failcode = failcode + (1 << 0); 43 | } 44 | #endif 45 | return failcode; 46 | } 47 | -------------------------------------------------------------------------------- /Tests/kernels_num_gangs.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:kernels,loop,V:2.5-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * restrict a = new real_t[n]; 8 | real_t * restrict b = new real_t[n]; 9 | 10 | for (int x = 0; x < n; ++x){ 11 | a[x] = rand() / (real_t)(RAND_MAX / 10); 12 | b[x] = 0; 13 | } 14 | 15 | #pragma acc data copyin(a[0:n]) copyout(b[0:n]) 16 | { 17 | #pragma acc kernels loop num_gangs(16) 18 | for (int x = 0; x < n; ++x){ 19 | b[x] = a[x]; 20 | } 21 | } 22 | 23 | for (int x = 0; x < n; ++x){ 24 | if (fabs(a[x] - b[x]) > PRECISION){ 25 | err += 1; 26 | } 27 | } 28 | 29 | return err; 30 | } 31 | #endif 32 | 33 | int main(){ 34 | int failcode = 0; 35 | int failed; 36 | #ifndef T1 37 | failed = 0; 38 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 39 | failed = failed + test1(); 40 | } 41 | if (failed != 0){ 42 | failcode = failcode + (1 << 0); 43 | } 44 | #endif 45 | return failcode; 46 | } 47 | -------------------------------------------------------------------------------- /Tests/kernels_num_workers.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:kernels,loop,V:2.5-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * restrict a = (real_t *)malloc(n * sizeof(real_t)); 8 | real_t * restrict b = (real_t *)malloc(n * sizeof(real_t)); 9 | 10 | for (int x = 0; x < n; ++x){ 11 | a[x] = rand() / (real_t)(RAND_MAX / 10); 12 | b[x] = 0; 13 | } 14 | 15 | #pragma acc data copyin(a[0:n]) copyout(b[0:n]) 16 | { 17 | #pragma acc kernels loop num_workers(16) 18 | for (int x = 0; x < n; ++x){ 19 | b[x] = a[x]; 20 | } 21 | } 22 | 23 | for (int x = 0; x < n; ++x){ 24 | if (fabs(a[x] - b[x]) > PRECISION){ 25 | err += 1; 26 | } 27 | } 28 | 29 | return err; 30 | } 31 | #endif 32 | 33 | int main(){ 34 | int failcode = 0; 35 | int failed; 36 | #ifndef T1 37 | failed = 0; 38 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 39 | failed = failed + test1(); 40 | } 41 | if (failed != 0){ 42 | failcode = failcode + (1 << 0); 43 | } 44 | #endif 45 | return failcode; 46 | } 47 | -------------------------------------------------------------------------------- /Tests/kernels_num_workers.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:kernels,loop,V:2.5-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * restrict a = new real_t[n]; 8 | real_t * restrict b = new real_t[n]; 9 | 10 | for (int x = 0; x < n; ++x){ 11 | a[x] = rand() / (real_t)(RAND_MAX / 10); 12 | b[x] = 0; 13 | } 14 | 15 | #pragma acc data copyin(a[0:n]) copyout(b[0:n]) 16 | { 17 | #pragma acc kernels loop num_workers(16) 18 | for (int x = 0; x < n; ++x){ 19 | b[x] = a[x]; 20 | } 21 | } 22 | 23 | for (int x = 0; x < n; ++x){ 24 | if (fabs(a[x] - b[x]) > PRECISION){ 25 | err += 1; 26 | } 27 | } 28 | 29 | return err; 30 | } 31 | #endif 32 | 33 | int main(){ 34 | int failcode = 0; 35 | int failed; 36 | #ifndef T1 37 | failed = 0; 38 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 39 | failed = failed + test1(); 40 | } 41 | if (failed != 0){ 42 | failcode = failcode + (1 << 0); 43 | } 44 | #endif 45 | return failcode; 46 | } 47 | -------------------------------------------------------------------------------- /Tests/kernels_present.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:kernels,data,structured-data,V:2.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = (real_t *)malloc(n * sizeof(real_t)); 8 | real_t * b = (real_t *)malloc(n * sizeof(real_t)); 9 | 10 | for (int x = 0; x < n; ++x){ 11 | a[x] = rand() / (real_t)(RAND_MAX / 10); 12 | b[x] = 0.0; 13 | } 14 | 15 | #pragma acc enter data copyin(a[0:n]) create(b[0:n]) 16 | #pragma acc kernels present(a[0:n], b[0:n]) 17 | { 18 | #pragma acc loop 19 | for (int x = 0; x < n; ++x){ 20 | b[x] = a[x]; 21 | } 22 | } 23 | #pragma acc exit data copyout(b[0:n]) delete(a[0:n]) 24 | 25 | for (int x = 0; x < n; ++x){ 26 | if (fabs(b[x] - a[x]) > PRECISION){ 27 | err += 1; 28 | } 29 | } 30 | 31 | return err; 32 | } 33 | #endif 34 | 35 | int main(){ 36 | int failcode = 0; 37 | int failed; 38 | #ifndef T1 39 | failed = 0; 40 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 41 | failed = failed + test1(); 42 | } 43 | if (failed != 0){ 44 | failcode = failcode + (1 << 0); 45 | } 46 | #endif 47 | return failcode; 48 | } 49 | -------------------------------------------------------------------------------- /Tests/kernels_present.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:kernels,data,structured-data,V:2.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = new real_t[n]; 8 | real_t * b = new real_t[n]; 9 | 10 | for (int x = 0; x < n; ++x){ 11 | a[x] = rand() / (real_t)(RAND_MAX / 10); 12 | b[x] = 0.0; 13 | } 14 | 15 | #pragma acc enter data copyin(a[0:n]) create(b[0:n]) 16 | #pragma acc kernels present(a[0:n], b[0:n]) 17 | { 18 | #pragma acc loop 19 | for (int x = 0; x < n; ++x){ 20 | b[x] = a[x]; 21 | } 22 | } 23 | #pragma acc exit data copyout(b[0:n]) delete(a[0:n]) 24 | 25 | for (int x = 0; x < n; ++x){ 26 | if (fabs(b[x] - a[x]) > PRECISION){ 27 | err += 1; 28 | } 29 | } 30 | 31 | return err; 32 | } 33 | #endif 34 | 35 | int main(){ 36 | int failcode = 0; 37 | int failed; 38 | #ifndef T1 39 | failed = 0; 40 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 41 | failed = failed + test1(); 42 | } 43 | if (failed != 0){ 44 | failcode = failcode + (1 << 0); 45 | } 46 | #endif 47 | return failcode; 48 | } 49 | -------------------------------------------------------------------------------- /Tests/kernels_vector_length.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:kernels,V:2.5-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = (real_t *)malloc(n * sizeof(real_t)); 8 | real_t * b = (real_t *)malloc(n * sizeof(real_t)); 9 | 10 | for (int x = 0; x < n; ++x){ 11 | a[x] = rand() / (real_t)(RAND_MAX / 10); 12 | b[x] = 0; 13 | } 14 | 15 | #pragma acc data copyin(a[0:n]) copyout(b[0:n]) 16 | { 17 | #pragma acc kernels vector_length(16) 18 | { 19 | #pragma acc loop vector 20 | for (int x = 0; x < n; ++x){ 21 | b[x] = a[x]; 22 | } 23 | } 24 | } 25 | 26 | for (int x = 0; x < n; ++x){ 27 | if (fabs(a[x] - b[x]) > PRECISION) { 28 | err += 1; 29 | } 30 | } 31 | 32 | return err; 33 | } 34 | #endif 35 | 36 | int main(){ 37 | int failcode = 0; 38 | int failed; 39 | #ifndef T1 40 | failed = 0; 41 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 42 | failed = failed + test1(); 43 | } 44 | if (failed != 0){ 45 | failcode = failcode + (1 << 0); 46 | } 47 | #endif 48 | return failcode; 49 | } 50 | -------------------------------------------------------------------------------- /Tests/kernels_vector_length.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:kernels,V:2.5-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = new real_t[n]; 8 | real_t * b = new real_t[n]; 9 | 10 | for (int x = 0; x < n; ++x){ 11 | a[x] = rand() / (real_t)(RAND_MAX / 10); 12 | b[x] = 0; 13 | } 14 | 15 | #pragma acc data copyin(a[0:n]) copyout(b[0:n]) 16 | { 17 | #pragma acc kernels vector_length(16) 18 | { 19 | #pragma acc loop vector 20 | for (int x = 0; x < n; ++x){ 21 | b[x] = a[x]; 22 | } 23 | } 24 | } 25 | 26 | for (int x = 0; x < n; ++x){ 27 | if (fabs(a[x] - b[x]) > PRECISION) { 28 | err += 1; 29 | } 30 | } 31 | 32 | return err; 33 | } 34 | #endif 35 | 36 | int main(){ 37 | int failcode = 0; 38 | int failed; 39 | #ifndef T1 40 | failed = 0; 41 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 42 | failed = failed + test1(); 43 | } 44 | if (failed != 0){ 45 | failcode = failcode + (1 << 0); 46 | } 47 | #endif 48 | return failcode; 49 | } 50 | -------------------------------------------------------------------------------- /Tests/kernels_wait.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:kernels,wait,V:2.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = (real_t *)malloc(n * sizeof(real_t)); 8 | real_t * b = (real_t *)malloc(n * sizeof(real_t)); 9 | real_t * c = (real_t *)malloc(n * sizeof(real_t)); 10 | 11 | for (int x = 0; x < n; ++x){ 12 | a[x] = rand() / (real_t)(RAND_MAX / 10); 13 | b[x] = rand() / (real_t)(RAND_MAX / 10); 14 | c[x] = 0.0; 15 | } 16 | 17 | #pragma acc enter data copyin(a[0:n], b[0:n], c[0:n]) async(1) 18 | #pragma acc kernels wait(1) 19 | { 20 | #pragma acc loop 21 | for (int x = 0; x < n; ++x){ 22 | c[x] += a[x] + b[x]; 23 | } 24 | } 25 | 26 | #pragma acc exit data copyout(c[0:n]) delete(a[0:n], b[0:n]) 27 | 28 | for (int x = 0; x < n; ++x){ 29 | if (fabs(c[x] - (a[x] + b[x])) > PRECISION) { 30 | err += 1; 31 | } 32 | } 33 | 34 | return err; 35 | } 36 | #endif 37 | 38 | int main(){ 39 | int failcode = 0; 40 | int failed; 41 | #ifndef T1 42 | failed = 0; 43 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 44 | failed = failed + test1(); 45 | } 46 | if (failed != 0){ 47 | failcode = failcode + (1 << 0); 48 | } 49 | #endif 50 | return failcode; 51 | } 52 | -------------------------------------------------------------------------------- /Tests/kernels_wait.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:kernels,wait,V:2.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = new real_t[n]; 8 | real_t * b = new real_t[n]; 9 | real_t * c = new real_t[n]; 10 | 11 | for (int x = 0; x < n; ++x){ 12 | a[x] = rand() / (real_t)(RAND_MAX / 10); 13 | b[x] = rand() / (real_t)(RAND_MAX / 10); 14 | c[x] = 0.0; 15 | } 16 | 17 | #pragma acc enter data copyin(a[0:n], b[0:n], c[0:n]) async(1) 18 | #pragma acc kernels wait(1) 19 | { 20 | #pragma acc loop 21 | for (int x = 0; x < n; ++x){ 22 | c[x] += a[x] + b[x]; 23 | } 24 | } 25 | 26 | #pragma acc exit data copyout(c[0:n]) delete(a[0:n], b[0:n]) 27 | 28 | for (int x = 0; x < n; ++x){ 29 | if (fabs(c[x] - (a[x] + b[x])) > PRECISION) { 30 | err += 1; 31 | } 32 | } 33 | 34 | return err; 35 | } 36 | #endif 37 | 38 | int main(){ 39 | int failcode = 0; 40 | int failed; 41 | #ifndef T1 42 | failed = 0; 43 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 44 | failed = failed + test1(); 45 | } 46 | if (failed != 0){ 47 | failcode = failcode + (1 << 0); 48 | } 49 | #endif 50 | return failcode; 51 | } 52 | -------------------------------------------------------------------------------- /Tests/parallel_create.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:parallel,data,data-region,V:1.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = new real_t[n]; 8 | real_t * b = new real_t[n]; 9 | real_t * c = new real_t[n]; 10 | 11 | for (int x = 0; x < n; ++x){ 12 | a[x] = rand() / (real_t)(RAND_MAX / 10); 13 | b[x] = 0.0; 14 | c[x] = 0.0; 15 | } 16 | 17 | #pragma acc data copyin(a[0:n]) copy(c[0:n]) 18 | { 19 | #pragma acc parallel create(b[0:n]) 20 | { 21 | #pragma acc loop 22 | for (int x = 0; x < n; ++x){ 23 | b[x] = a[x]; 24 | } 25 | #pragma acc loop 26 | for (int x = 0; x < n; ++x){ 27 | c[x] = b[x]; 28 | } 29 | } 30 | } 31 | 32 | for (int x = 0; x < n; ++x){ 33 | if (fabs(a[x] - c[x]) > PRECISION){ 34 | err = 1; 35 | } 36 | } 37 | 38 | return err; 39 | } 40 | #endif 41 | 42 | int main(){ 43 | int failcode = 0; 44 | int failed; 45 | #ifndef T1 46 | failed = 0; 47 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 48 | failed = failed + test1(); 49 | } 50 | if (failed != 0){ 51 | failcode = failcode + (1 << 0); 52 | } 53 | #endif 54 | return failcode; 55 | } 56 | -------------------------------------------------------------------------------- /Tests/parallel_create_zero.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //#T1:parallel,data,data_region,V:3.0-3.2 4 | int Test1(){ 5 | int err=0; 6 | srand(SEED); 7 | real_t * a = (real_t *)malloc(n * sizeof(real_t)); 8 | real_t * b = (real_t *)malloc(n * sizeof(real_t)); 9 | 10 | for( int x = 0; x < n; x++){ 11 | a[x] = rand() / (real_t)(RAND_MAX / 10); 12 | b[x] = 0.0; 13 | } 14 | 15 | #pragma acc data copyin(a[0:n]) copyout(b[0:n] 16 | { 17 | #pragma acc parallel create(zero: b[0:n]) 18 | { 19 | #pragma acc loop 20 | { 21 | for(int x = 0; x < n; x++){ 22 | b[x] += a[x]; 23 | } 24 | } 25 | } 26 | } 27 | for (int x = 0; x < n; ++x){ 28 | if (fabs(a[x] - b[x]) > PRECISION){ 29 | err = 1; 30 | } 31 | } 32 | 33 | return err; 34 | } 35 | #endif 36 | 37 | int main(){ 38 | int failcode = 0; 39 | int failed; 40 | #ifndef T1 41 | failed = 0; 42 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 43 | failed = failed + test1(); 44 | } 45 | if (failed != 0){ 46 | failcode = failcode + (1 << 0); 47 | } 48 | #endif 49 | return failcode; 50 | } -------------------------------------------------------------------------------- /Tests/parallel_create_zero.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //#T1:parallel,data,data_region,V:3.0-3.2 4 | int Test1(){ 5 | int err=0; 6 | srand(SEED); 7 | real_t * a = new real_t[n]; 8 | real_t * b = new real_t[n]; 9 | 10 | for( int x = 0; x < n; x++){ 11 | a[x] = rand() / (real_t)(RAND_MAX / 10); 12 | b[x] = 0.0; 13 | } 14 | 15 | #pragma acc data copyin(a[0:n]) copyout(b[0:n] 16 | { 17 | #pragma acc parallel create(zero: b[0:n]) 18 | { 19 | #pragma acc loop 20 | { 21 | for(int x = 0; x < n; x++){ 22 | b[x] += a[x]; 23 | } 24 | } 25 | } 26 | } 27 | for (int x = 0; x < n; ++x){ 28 | if (fabs(a[x] - b[x]) > PRECISION){ 29 | err = 1; 30 | } 31 | } 32 | 33 | return err; 34 | } 35 | #endif 36 | 37 | int main(){ 38 | int failcode = 0; 39 | int failed; 40 | #ifndef T1 41 | failed = 0; 42 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 43 | failed = failed + test1(); 44 | } 45 | if (failed != 0){ 46 | failcode = failcode + (1 << 0); 47 | } 48 | #endif 49 | return failcode; 50 | } -------------------------------------------------------------------------------- /Tests/parallel_default_present.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:parallel,default,data,data-region,V:2.5-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = (real_t *)malloc(n * sizeof(real_t)); 8 | 9 | for (int x = 0; x < n; ++x){ 10 | a[x] = 0.0; 11 | } 12 | #pragma acc enter data copyin(a[0:n]) 13 | #pragma acc parallel default(present) 14 | { 15 | #pragma acc loop 16 | for (int x = 0; x < n; ++x){ 17 | a[x] = 1.0; 18 | } 19 | } 20 | #pragma acc exit data copyout(a[0:n]) 21 | 22 | for (int x = 0; x < n; ++x){ 23 | if (fabs(a[x] - 1.0) > PRECISION){ 24 | err = 1; 25 | } 26 | } 27 | 28 | return err; 29 | } 30 | #endif 31 | 32 | int main(){ 33 | int failcode = 0; 34 | int failed; 35 | #ifndef T1 36 | failed = 0; 37 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 38 | failed = failed + test1(); 39 | } 40 | if (failed != 0){ 41 | failcode = failcode + (1 << 0); 42 | } 43 | #endif 44 | return failcode; 45 | } 46 | -------------------------------------------------------------------------------- /Tests/parallel_default_present.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:parallel,default,data,data-region,V:2.5-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = new real_t[n]; 8 | 9 | for (int x = 0; x < n; ++x){ 10 | a[x] = 0.0; 11 | } 12 | #pragma acc enter data copyin(a[0:n]) 13 | #pragma acc parallel default(present) 14 | { 15 | #pragma acc loop 16 | for (int x = 0; x < n; ++x){ 17 | a[x] = 1.0; 18 | } 19 | } 20 | #pragma acc exit data copyout(a[0:n]) 21 | 22 | for (int x = 0; x < n; ++x){ 23 | if (fabs(a[x] - 1.0) > PRECISION){ 24 | err = 1; 25 | } 26 | } 27 | 28 | return err; 29 | } 30 | #endif 31 | 32 | int main(){ 33 | int failcode = 0; 34 | int failed; 35 | #ifndef T1 36 | failed = 0; 37 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 38 | failed = failed + test1(); 39 | } 40 | if (failed != 0){ 41 | failcode = failcode + (1 << 0); 42 | } 43 | #endif 44 | return failcode; 45 | } 46 | -------------------------------------------------------------------------------- /Tests/parallel_independent_atomic_capture.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:atomic,construct-independent,V:2.7-3.2 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t *a = (real_t *)malloc(n * sizeof(real_t)); 8 | real_t *b = (real_t *)malloc(n * sizeof(real_t)); 9 | 10 | for (int x = 0; x < n; ++x){ 11 | a[x] = rand() / (real_t)(RAND_MAX / 10); 12 | b[x] = rand() / (real_t)(RAND_MAX / 10); 13 | } 14 | 15 | #pragma acc data copy(a[0:n], b[0:n]) 16 | { 17 | #pragma acc parallel 18 | { 19 | #pragma acc loop independent 20 | for (int x = 0; x < n; ++x){ 21 | #pragma acc atomic capture 22 | b[x] = (a[x])++; 23 | } 24 | } 25 | } 26 | 27 | for (int x = 0; x < n; ++x){ 28 | if (fabs(a[x] - (b[x] + 1)) > PRECISION){ 29 | err += 1; 30 | } 31 | } 32 | 33 | return err; 34 | } 35 | #endif 36 | 37 | int main(){ 38 | int failcode = 0; 39 | int failed; 40 | #ifndef T1 41 | failed = 0; 42 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 43 | failed = failed + test1(); 44 | } 45 | if (failed != 0){ 46 | failcode = failcode + (1 << 0); 47 | } 48 | #endif 49 | return failcode; 50 | } 51 | 52 | -------------------------------------------------------------------------------- /Tests/parallel_independent_atomic_capture.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:atomic,construct-independent,V:2.7-3.2 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t *a = new real_t[n]; 8 | real_t *b = new real_t[n]; 9 | 10 | for (int x = 0; x < n; ++x){ 11 | a[x] = rand() / (real_t)(RAND_MAX / 10); 12 | b[x] = rand() / (real_t)(RAND_MAX / 10); 13 | } 14 | 15 | #pragma acc data copy(a[0:n], b[0:n]) 16 | { 17 | #pragma acc parallel 18 | { 19 | #pragma acc loop independent 20 | for (int x = 0; x < n; ++x){ 21 | #pragma acc atomic capture 22 | b[x] = (a[x])++; 23 | } 24 | } 25 | } 26 | 27 | for (int x = 0; x < n; ++x){ 28 | if (fabs(a[x] - (b[x] + 1)) > PRECISION){ 29 | err += 1; 30 | } 31 | } 32 | 33 | return err; 34 | } 35 | #endif 36 | 37 | int main(){ 38 | int failcode = 0; 39 | int failed; 40 | #ifndef T1 41 | failed = 0; 42 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 43 | failed = failed + test1(); 44 | } 45 | if (failed != 0){ 46 | failcode = failcode + (1 << 0); 47 | } 48 | #endif 49 | return failcode; 50 | } 51 | 52 | -------------------------------------------------------------------------------- /Tests/parallel_independent_atomic_read.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:atomic,construct-independent,V:2.7-3.2 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t *a = (real_t *)malloc(n * sizeof(real_t)); 8 | real_t *b = (real_t *)malloc(n * sizeof(real_t)); 9 | 10 | for (int x = 0; x < n; ++x){ 11 | a[x] = rand() / (real_t)(RAND_MAX / 10); 12 | b[x] = rand() / (real_t)(RAND_MAX / 10); 13 | } 14 | 15 | #pragma acc data copy(a[0:n], b[0:n]) 16 | { 17 | #pragma acc parallel 18 | { 19 | #pragma acc loop independent 20 | for (int x = 0; x < n; ++x){ 21 | #pragma acc atomic read 22 | b[x] = a[x]; 23 | } 24 | } 25 | } 26 | 27 | for (int x = 0; x < n; ++x){ 28 | if (fabs(a[x] - b[x]) > PRECISION){ 29 | err += 1; 30 | } 31 | } 32 | 33 | return err; 34 | } 35 | #endif 36 | 37 | int main(){ 38 | int failcode = 0; 39 | int failed; 40 | #ifndef T1 41 | failed = 0; 42 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 43 | failed = failed + test1(); 44 | } 45 | if (failed != 0){ 46 | failcode = failcode + (1 << 0); 47 | } 48 | #endif 49 | return failcode; 50 | } 51 | 52 | -------------------------------------------------------------------------------- /Tests/parallel_independent_atomic_read.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:atomic,construct-independent,V:2.7-3.2 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t *a = new real_t[n]; 8 | real_t *b = new real_t[n]; 9 | 10 | for (int x = 0; x < n; ++x){ 11 | a[x] = rand() / (real_t)(RAND_MAX / 10); 12 | b[x] = rand() / (real_t)(RAND_MAX / 10); 13 | } 14 | 15 | #pragma acc data copy(a[0:n], b[0:n]) 16 | { 17 | #pragma acc parallel 18 | { 19 | #pragma acc loop independent 20 | for (int x = 0; x < n; ++x){ 21 | #pragma acc atomic read 22 | b[x] = a[x]; 23 | } 24 | } 25 | } 26 | 27 | for (int x = 0; x < n; ++x){ 28 | if (fabs(a[x] - b[x]) > PRECISION){ 29 | err += 1; 30 | } 31 | } 32 | 33 | return err; 34 | } 35 | #endif 36 | 37 | int main(){ 38 | int failcode = 0; 39 | int failed; 40 | #ifndef T1 41 | failed = 0; 42 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 43 | failed = failed + test1(); 44 | } 45 | if (failed != 0){ 46 | failcode = failcode + (1 << 0); 47 | } 48 | #endif 49 | return failcode; 50 | } 51 | 52 | -------------------------------------------------------------------------------- /Tests/parallel_independent_atomic_update.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:atomic,construct-independent,V:2.7-3.2 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t *a = (real_t *)malloc(n * sizeof(real_t)); 8 | real_t *b = (real_t *)malloc(n * sizeof(real_t)); 9 | 10 | for (int x = 0; x < n; ++x){ 11 | a[x] = rand() / (real_t)(RAND_MAX / 10); 12 | b[x] = a[x]; 13 | } 14 | 15 | #pragma acc data copy(a[0:n]) 16 | { 17 | #pragma acc parallel 18 | { 19 | #pragma acc loop independent 20 | for (int x = 0; x < n; ++x){ 21 | #pragma acc atomic update 22 | (a[x])++; 23 | } 24 | } 25 | } 26 | 27 | for (int x = 0; x < n; ++x){ 28 | if (fabs(a[x] - (b[x] + 1)) > PRECISION){ 29 | err += 1; 30 | } 31 | } 32 | 33 | return err; 34 | } 35 | #endif 36 | 37 | int main(){ 38 | int failcode = 0; 39 | int failed; 40 | #ifndef T1 41 | failed = 0; 42 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 43 | failed = failed + test1(); 44 | } 45 | if (failed != 0){ 46 | failcode = failcode + (1 << 0); 47 | } 48 | #endif 49 | return failcode; 50 | } 51 | 52 | -------------------------------------------------------------------------------- /Tests/parallel_independent_atomic_update.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:atomic,construct-independent,V:2.7-3.2 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t *a = new real_t[n]; 8 | real_t *b = new real_t[n]; 9 | 10 | for (int x = 0; x < n; ++x){ 11 | a[x] = rand() / (real_t)(RAND_MAX / 10); 12 | b[x] = a[x]; 13 | } 14 | 15 | #pragma acc data copy(a[0:n]) 16 | { 17 | #pragma acc parallel 18 | { 19 | #pragma acc loop independent 20 | for (int x = 0; x < n; ++x){ 21 | #pragma acc atomic update 22 | (a[x])++; 23 | } 24 | } 25 | } 26 | 27 | for (int x = 0; x < n; ++x){ 28 | if (fabs(a[x] - (b[x] + 1)) > PRECISION){ 29 | err += 1; 30 | } 31 | } 32 | 33 | return err; 34 | } 35 | #endif 36 | 37 | int main(){ 38 | int failcode = 0; 39 | int failed; 40 | #ifndef T1 41 | failed = 0; 42 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 43 | failed = failed + test1(); 44 | } 45 | if (failed != 0){ 46 | failcode = failcode + (1 << 0); 47 | } 48 | #endif 49 | return failcode; 50 | } 51 | 52 | -------------------------------------------------------------------------------- /Tests/parallel_independent_atomic_write.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:atomic,construct-independent,V:2.7-3.2 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t *a = (real_t *)malloc(n * sizeof(real_t)); 8 | real_t *b = (real_t *)malloc(n * sizeof(real_t)); 9 | 10 | for (int x = 0; x < n; ++x){ 11 | a[x] = rand() / (real_t)(RAND_MAX / 10); 12 | b[x] = rand() / (real_t)(RAND_MAX / 10); 13 | } 14 | 15 | #pragma acc data copy(a[0:n], b[0:n]) 16 | { 17 | #pragma acc parallel 18 | { 19 | #pragma acc loop independent 20 | for (int x = 0; x < n; ++x){ 21 | #pragma acc atomic write 22 | b[x] = a[x]; 23 | } 24 | } 25 | } 26 | 27 | for (int x = 0; x < n; ++x){ 28 | if (fabs(a[x] - b[x]) > PRECISION){ 29 | err += 1; 30 | } 31 | } 32 | 33 | return err; 34 | } 35 | #endif 36 | 37 | 38 | int main(){ 39 | int failcode = 0; 40 | int failed; 41 | #ifndef T1 42 | failed = 0; 43 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 44 | failed = failed + test1(); 45 | } 46 | if (failed != 0){ 47 | failcode = failcode + (1 << 0); 48 | } 49 | #endif 50 | return failcode; 51 | } 52 | 53 | -------------------------------------------------------------------------------- /Tests/parallel_independent_atomic_write.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:atomic,construct-independent,V:2.7-3.2 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t *a = new real_t[n]; 8 | real_t *b = new real_t[n]; 9 | 10 | for (int x = 0; x < n; ++x){ 11 | a[x] = rand() / (real_t)(RAND_MAX / 10); 12 | b[x] = rand() / (real_t)(RAND_MAX / 10); 13 | } 14 | 15 | #pragma acc data copy(a[0:n], b[0:n]) 16 | { 17 | #pragma acc parallel 18 | { 19 | #pragma acc loop independent 20 | for (int x = 0; x < n; ++x){ 21 | #pragma acc atomic write 22 | b[x] = a[x]; 23 | } 24 | } 25 | } 26 | 27 | for (int x = 0; x < n; ++x){ 28 | if (fabs(a[x] - b[x]) > PRECISION){ 29 | err += 1; 30 | } 31 | } 32 | 33 | return err; 34 | } 35 | #endif 36 | 37 | 38 | int main(){ 39 | int failcode = 0; 40 | int failed; 41 | #ifndef T1 42 | failed = 0; 43 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 44 | failed = failed + test1(); 45 | } 46 | if (failed != 0){ 47 | failcode = failcode + (1 << 0); 48 | } 49 | #endif 50 | return failcode; 51 | } 52 | 53 | -------------------------------------------------------------------------------- /Tests/parallel_loop_auto.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | 3 | #ifndef T1 4 | //T1:parallel,loop,combined-constructs,V:2.0-2.7 5 | //data dependent, treated with as a seq clause. Added the num_gangs clause with 1 6 | int test1(){ 7 | int err = 0; 8 | srand(SEED); 9 | real_t * device = new real_t[n]; 10 | real_t * host = new real_t[n]; 11 | 12 | for (int x = 0; x < n; ++x){ 13 | device[x] = rand() / (real_t)(RAND_MAX / 10); 14 | host[x] = device[x]; 15 | } 16 | 17 | #pragma acc data copy(device[0:n]) 18 | { 19 | #pragma acc parallel loop num_gangs(1) vector_length(1) num_workers(1) auto 20 | for (int x = 1; x < n; ++x){ 21 | device[x] = device[x - 1] + device[x]; 22 | } 23 | } 24 | 25 | real_t rolling_total = 0.0; 26 | for (int x = 0; x < n; ++x){ 27 | rolling_total += host[x]; 28 | if (fabs(rolling_total - device[x]) > PRECISION){ 29 | err = 1; 30 | } 31 | } 32 | 33 | delete[] device; 34 | delete[] host; 35 | 36 | return err; 37 | } 38 | 39 | 40 | #endif 41 | 42 | int main(){ 43 | int failcode = 0; 44 | int failed; 45 | 46 | #ifndef T1 47 | failed = 0; 48 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 49 | failed += test1(); 50 | } 51 | if (failed){ 52 | failcode += (1 << 2); 53 | } 54 | #endif 55 | return failcode; 56 | } -------------------------------------------------------------------------------- /Tests/parallel_loop_gang.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:parallel,loop,combined-constructs,V:1.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = (real_t *)malloc(n * sizeof(real_t)); 8 | real_t * b = (real_t *)malloc(n * sizeof(real_t)); 9 | real_t * c = (real_t *)malloc(n * sizeof(real_t)); 10 | 11 | for (int x = 0; x < n; ++x){ 12 | a[x] = rand() / (real_t)(RAND_MAX / 10); 13 | b[x] = rand() / (real_t)(RAND_MAX / 10); 14 | c[x] = 0.0; 15 | } 16 | 17 | #pragma acc data copyin(a[0:n], b[0:n]) copy(c[0:n]) 18 | { 19 | #pragma acc parallel loop gang 20 | for (int x = 0; x < n; ++x){ 21 | c[x] = a[x] + b[x]; 22 | } 23 | } 24 | 25 | for (int x = 0; x < n; ++x){ 26 | if (fabs(c[x] - (a[x] + b[x])) > PRECISION){ 27 | err = 1; 28 | } 29 | } 30 | 31 | return err; 32 | } 33 | #endif 34 | 35 | int main(){ 36 | int failcode = 0; 37 | int failed; 38 | #ifndef T1 39 | failed = 0; 40 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 41 | failed = failed + test1(); 42 | } 43 | if (failed != 0){ 44 | failcode = failcode + (1 << 0); 45 | } 46 | #endif 47 | return failcode; 48 | } 49 | -------------------------------------------------------------------------------- /Tests/parallel_loop_gang.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:parallel,loop,combined-constructs,V:1.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = new real_t[n]; 8 | real_t * b = new real_t[n]; 9 | real_t * c = new real_t[n]; 10 | 11 | for (int x = 0; x < n; ++x){ 12 | a[x] = rand() / (real_t)(RAND_MAX / 10); 13 | b[x] = rand() / (real_t)(RAND_MAX / 10); 14 | c[x] = 0.0; 15 | } 16 | 17 | #pragma acc data copyin(a[0:n], b[0:n]) copy(c[0:n]) 18 | { 19 | #pragma acc parallel loop gang 20 | for (int x = 0; x < n; ++x){ 21 | c[x] = a[x] + b[x]; 22 | } 23 | } 24 | 25 | for (int x = 0; x < n; ++x){ 26 | if (fabs(c[x] - (a[x] + b[x])) > PRECISION){ 27 | err = 1; 28 | } 29 | } 30 | 31 | return err; 32 | } 33 | #endif 34 | 35 | int main(){ 36 | int failcode = 0; 37 | int failed; 38 | #ifndef T1 39 | failed = 0; 40 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 41 | failed = failed + test1(); 42 | } 43 | if (failed != 0){ 44 | failcode = failcode + (1 << 0); 45 | } 46 | #endif 47 | return failcode; 48 | } 49 | -------------------------------------------------------------------------------- /Tests/parallel_loop_independent.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:parallel,loop,combined-constructs,V:2.7-3.2 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = (real_t *)malloc(n * sizeof(real_t)); 8 | real_t * b = (real_t *)malloc(n * sizeof(real_t)); 9 | 10 | for (int x = 0; x < n; ++x){ 11 | a[x] = rand() / (real_t)(RAND_MAX / 10); 12 | } 13 | 14 | #pragma acc data copy(a[0:n]) copyout(b[0:n]) 15 | { 16 | #pragma acc parallel loop independent 17 | for (int x = 0; x < n; ++x){ 18 | b[x] = a[x]; 19 | } 20 | } 21 | 22 | for (int x = 0; x < n; ++x){ 23 | if (fabs(a[x] - b[x]) > PRECISION){ 24 | err = 1; 25 | } 26 | } 27 | 28 | return err; 29 | } 30 | #endif 31 | 32 | int main(){ 33 | int failcode = 0; 34 | int failed; 35 | #ifndef T1 36 | failed = 0; 37 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 38 | failed = failed + test1(); 39 | } 40 | if (failed != 0){ 41 | failcode = failcode + (1 << 0); 42 | } 43 | #endif 44 | return failcode; 45 | } 46 | -------------------------------------------------------------------------------- /Tests/parallel_loop_independent.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:parallel,loop,combined-constructs,V:2.7-3.2 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = new real_t[n]; 8 | real_t * b = new real_t[n]; 9 | 10 | for (int x = 0; x < n; ++x){ 11 | a[x] = rand() / (real_t)(RAND_MAX / 10); 12 | } 13 | 14 | #pragma acc data copy(a[0:n]) copyout(b[0:n]) 15 | { 16 | #pragma acc parallel loop independent 17 | for (int x = 0; x < n; ++x){ 18 | b[x] = a[x]; 19 | } 20 | } 21 | 22 | for (int x = 0; x < n; ++x){ 23 | if (fabs(a[x] - b[x]) > PRECISION){ 24 | err = 1; 25 | } 26 | } 27 | 28 | return err; 29 | } 30 | #endif 31 | 32 | int main(){ 33 | int failcode = 0; 34 | int failed; 35 | #ifndef T1 36 | failed = 0; 37 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 38 | failed = failed + test1(); 39 | } 40 | if (failed != 0){ 41 | failcode = failcode + (1 << 0); 42 | } 43 | #endif 44 | return failcode; 45 | } 46 | -------------------------------------------------------------------------------- /Tests/parallel_loop_independent_reduction.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:parallel,reduction,V:2.7-3.2 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = (real_t *)malloc(n * sizeof(real_t)); 8 | real_t reduction; 9 | 10 | for (int x = 0; x < n; ++x){ 11 | a[x] = rand() / (real_t)(RAND_MAX / 10); 12 | } 13 | 14 | #pragma acc parallel copyin(a[0:n]) reduction(+:reduction) 15 | { 16 | #pragma acc loop independent 17 | for (int x = 0; x < n; ++x){ 18 | reduction = reduction + a[x]; 19 | } 20 | } 21 | 22 | for (int x = 0; x < n; ++x){ 23 | reduction = reduction - a[x]; 24 | } 25 | if (fabs(reduction) > PRECISION){ 26 | err += 1; 27 | } 28 | 29 | return err; 30 | } 31 | #endif 32 | 33 | int main(){ 34 | int failcode = 0; 35 | int failed; 36 | #ifndef T1 37 | failed = 0; 38 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 39 | failed = failed + test1(); 40 | } 41 | if (failed != 0){ 42 | failcode = failcode + (1 << 0); 43 | } 44 | #endif 45 | return failcode; 46 | } 47 | 48 | -------------------------------------------------------------------------------- /Tests/parallel_loop_independent_reduction.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:parallel,reduction,V:2.7-3.2 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = new real_t[n]; 8 | real_t reduction; 9 | 10 | for (int x = 0; x < n; ++x){ 11 | a[x] = rand() / (real_t)(RAND_MAX / 10); 12 | } 13 | 14 | #pragma acc parallel copyin(a[0:n]) reduction(+:reduction) 15 | { 16 | #pragma acc loop independent 17 | for (int x = 0; x < n; ++x){ 18 | reduction = reduction + a[x]; 19 | } 20 | } 21 | 22 | for (int x = 0; x < n; ++x){ 23 | reduction = reduction - a[x]; 24 | } 25 | if (fabs(reduction) > PRECISION){ 26 | err += 1; 27 | } 28 | 29 | return err; 30 | } 31 | #endif 32 | 33 | int main(){ 34 | int failcode = 0; 35 | int failed; 36 | #ifndef T1 37 | failed = 0; 38 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 39 | failed = failed + test1(); 40 | } 41 | if (failed != 0){ 42 | failcode = failcode + (1 << 0); 43 | } 44 | #endif 45 | return failcode; 46 | } 47 | 48 | -------------------------------------------------------------------------------- /Tests/parallel_loop_seq.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:parallel,loop,combined-constructs,V:1.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = (real_t *)malloc(n * sizeof(real_t)); 8 | real_t * b = (real_t *)malloc(n * sizeof(real_t)); 9 | real_t temp = 0.0; 10 | 11 | for (int x = 0; x < n; ++x){ 12 | a[x] = rand() / (real_t)(RAND_MAX / 10); 13 | b[x] = 0.0; 14 | } 15 | 16 | #pragma acc data copyin(a[0:n]) copy(b[0:n]) 17 | { 18 | #pragma acc parallel loop seq 19 | for (int x = 1; x < n; ++x){ 20 | b[x] = b[x-1] + a[x]; 21 | } 22 | } 23 | 24 | for (int x = 1; x < n; ++x){ 25 | temp += a[x]; 26 | if (fabs(b[x] - temp) > PRECISION){ 27 | err = 1; 28 | } 29 | } 30 | 31 | return err; 32 | } 33 | #endif 34 | 35 | int main(){ 36 | int failcode = 0; 37 | int failed; 38 | #ifndef T1 39 | failed = 0; 40 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 41 | failed = failed + test1(); 42 | } 43 | if (failed != 0){ 44 | failcode = failcode + (1 << 0); 45 | } 46 | #endif 47 | return failcode; 48 | } 49 | -------------------------------------------------------------------------------- /Tests/parallel_loop_seq.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:parallel,loop,combined-constructs,V:1.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = new real_t[n]; 8 | real_t * b = new real_t[n]; 9 | real_t temp = 0.0; 10 | 11 | for (int x = 0; x < n; ++x){ 12 | a[x] = rand() / (real_t)(RAND_MAX / 10); 13 | b[x] = 0.0; 14 | } 15 | 16 | #pragma acc data copyin(a[0:n]) copy(b[0:n]) 17 | { 18 | #pragma acc parallel loop seq 19 | for (int x = 1; x < n; ++x){ 20 | b[x] = b[x-1] + a[x]; 21 | } 22 | } 23 | 24 | for (int x = 1; x < n; ++x){ 25 | temp += a[x]; 26 | if (fabs(b[x] - temp) > PRECISION){ 27 | err = 1; 28 | } 29 | } 30 | 31 | return err; 32 | } 33 | #endif 34 | 35 | int main(){ 36 | int failcode = 0; 37 | int failed; 38 | #ifndef T1 39 | failed = 0; 40 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 41 | failed = failed + test1(); 42 | } 43 | if (failed != 0){ 44 | failcode = failcode + (1 << 0); 45 | } 46 | #endif 47 | return failcode; 48 | } 49 | -------------------------------------------------------------------------------- /Tests/parallel_loop_vector.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:parallel,loop,vector,combined-constructs,V:1.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = (real_t *)malloc(n * sizeof(real_t)); 8 | real_t * b = (real_t *)malloc(n * sizeof(real_t)); 9 | real_t * c = (real_t *)malloc(n * sizeof(real_t)); 10 | 11 | for (int x = 0; x < n; ++x){ 12 | a[x] = rand() / (real_t)(RAND_MAX / 10); 13 | b[x] = rand() / (real_t)(RAND_MAX / 10); 14 | c[x] = 0.0; 15 | } 16 | 17 | #pragma acc data copyin(a[0:n], b[0:n]) copy(c[0:n]) 18 | { 19 | #pragma acc parallel loop vector 20 | for (int x = 0; x < n; ++x){ 21 | c[x] = a[x] + b[x]; 22 | } 23 | } 24 | 25 | for (int x = 0; x < n; ++x){ 26 | if(fabs(c[x] - (a[x] + b[x])) > PRECISION){ 27 | err = 1; 28 | } 29 | } 30 | 31 | return err; 32 | } 33 | #endif 34 | 35 | int main(){ 36 | int failcode = 0; 37 | int failed; 38 | #ifndef T1 39 | failed = 0; 40 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 41 | failed = failed + test1(); 42 | } 43 | if (failed != 0){ 44 | failcode = failcode + (1 << 0); 45 | } 46 | #endif 47 | return failcode; 48 | } 49 | -------------------------------------------------------------------------------- /Tests/parallel_loop_vector.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:parallel,loop,vector,combined-constructs,V:1.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = new real_t[n]; 8 | real_t * b = new real_t[n]; 9 | real_t * c = new real_t[n]; 10 | 11 | for (int x = 0; x < n; ++x){ 12 | a[x] = rand() / (real_t)(RAND_MAX / 10); 13 | b[x] = rand() / (real_t)(RAND_MAX / 10); 14 | c[x] = 0.0; 15 | } 16 | 17 | #pragma acc data copyin(a[0:n], b[0:n]) copy(c[0:n]) 18 | { 19 | #pragma acc parallel loop vector 20 | for (int x = 0; x < n; ++x){ 21 | c[x] = a[x] + b[x]; 22 | } 23 | } 24 | 25 | for (int x = 0; x < n; ++x){ 26 | if(fabs(c[x] - (a[x] + b[x])) > PRECISION){ 27 | err = 1; 28 | } 29 | } 30 | 31 | return err; 32 | } 33 | #endif 34 | 35 | int main(){ 36 | int failcode = 0; 37 | int failed; 38 | #ifndef T1 39 | failed = 0; 40 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 41 | failed = failed + test1(); 42 | } 43 | if (failed != 0){ 44 | failcode = failcode + (1 << 0); 45 | } 46 | #endif 47 | return failcode; 48 | } 49 | -------------------------------------------------------------------------------- /Tests/parallel_loop_worker.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:parallel,loop,combined-constructs,V:1.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = (real_t *)malloc(n * sizeof(real_t)); 8 | real_t * b = (real_t *)malloc(n * sizeof(real_t)); 9 | real_t * c = (real_t *)malloc(n * sizeof(real_t)); 10 | 11 | for (int x = 0; x < n; ++x){ 12 | a[x] = rand() / (real_t)(RAND_MAX / 10); 13 | b[x] = rand() / (real_t)(RAND_MAX / 10); 14 | c[x] = 0.0; 15 | } 16 | 17 | #pragma acc data copyin(a[0:n], b[0:n]) copy(c[0:n]) 18 | { 19 | #pragma acc parallel loop worker 20 | for (int x = 0; x < n; ++x){ 21 | c[x] = a[x] + b[x]; 22 | } 23 | } 24 | 25 | for (int x = 0; x < n; ++x){ 26 | if (fabs(c[x] - (a[x] + b[x])) > PRECISION){ 27 | err = 1; 28 | } 29 | } 30 | 31 | return err; 32 | } 33 | #endif 34 | 35 | int main(){ 36 | int failcode = 0; 37 | int failed; 38 | #ifndef T1 39 | failed = 0; 40 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 41 | failed = failed + test1(); 42 | } 43 | if (failed != 0){ 44 | failcode = failcode + (1 << 0); 45 | } 46 | #endif 47 | return failcode; 48 | } 49 | -------------------------------------------------------------------------------- /Tests/parallel_loop_worker.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:parallel,loop,combined-constructs,V:1.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = new real_t[n]; 8 | real_t * b = new real_t[n]; 9 | real_t * c = new real_t[n]; 10 | 11 | for (int x = 0; x < n; ++x){ 12 | a[x] = rand() / (real_t)(RAND_MAX / 10); 13 | b[x] = rand() / (real_t)(RAND_MAX / 10); 14 | c[x] = 0.0; 15 | } 16 | 17 | #pragma acc data copyin(a[0:n], b[0:n]) copy(c[0:n]) 18 | { 19 | #pragma acc parallel loop worker 20 | for (int x = 0; x < n; ++x){ 21 | c[x] = a[x] + b[x]; 22 | } 23 | } 24 | 25 | for (int x = 0; x < n; ++x){ 26 | if (fabs(c[x] - (a[x] + b[x])) > PRECISION){ 27 | err = 1; 28 | } 29 | } 30 | 31 | return err; 32 | } 33 | #endif 34 | 35 | int main(){ 36 | int failcode = 0; 37 | int failed; 38 | #ifndef T1 39 | failed = 0; 40 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 41 | failed = failed + test1(); 42 | } 43 | if (failed != 0){ 44 | failcode = failcode + (1 << 0); 45 | } 46 | #endif 47 | return failcode; 48 | } 49 | -------------------------------------------------------------------------------- /Tests/parallel_present.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:parallel,present,V:2.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = (real_t *)malloc(n * sizeof(real_t)); 8 | real_t * b = (real_t *)malloc(n * sizeof(real_t)); 9 | real_t * c = (real_t *)malloc(n * sizeof(real_t)); 10 | 11 | for (int x = 0; x < n; ++x){ 12 | a[x] = rand() / (real_t)(RAND_MAX / 10); 13 | b[x] = rand() / (real_t)(RAND_MAX / 10); 14 | c[x] = 0.0; 15 | } 16 | 17 | #pragma acc enter data copyin(a[0:n], b[0:n]) 18 | #pragma acc parallel present(a[0:n], b[0:n]) copy(c[0:n]) 19 | { 20 | #pragma acc loop 21 | for (int x = 0; x < n; ++x){ 22 | c[x] = a[x] + b[x]; 23 | } 24 | } 25 | #pragma acc exit data delete(a[0:n], b[0:n]) 26 | 27 | for (int x = 0; x < n; ++x){ 28 | if (fabs(c[x] - (a[x] + b[x])) > PRECISION){ 29 | err += 1; 30 | } 31 | } 32 | 33 | return err; 34 | } 35 | #endif 36 | 37 | int main(){ 38 | int failcode = 0; 39 | int failed; 40 | #ifndef T1 41 | failed = 0; 42 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 43 | failed = failed + test1(); 44 | } 45 | if (failed != 0){ 46 | failcode = failcode + (1 << 0); 47 | } 48 | #endif 49 | return failcode; 50 | } 51 | -------------------------------------------------------------------------------- /Tests/parallel_present.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:parallel,present,V:2.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = new real_t[n]; 8 | real_t * b = new real_t[n]; 9 | real_t * c = new real_t[n]; 10 | 11 | for (int x = 0; x < n; ++x){ 12 | a[x] = rand() / (real_t)(RAND_MAX / 10); 13 | b[x] = rand() / (real_t)(RAND_MAX / 10); 14 | c[x] = 0.0; 15 | } 16 | 17 | #pragma acc enter data copyin(a[0:n], b[0:n]) 18 | #pragma acc parallel present(a[0:n], b[0:n]) copy(c[0:n]) 19 | { 20 | #pragma acc loop 21 | for (int x = 0; x < n; ++x){ 22 | c[x] = a[x] + b[x]; 23 | } 24 | } 25 | #pragma acc exit data delete(a[0:n], b[0:n]) 26 | 27 | for (int x = 0; x < n; ++x){ 28 | if (fabs(c[x] - (a[x] + b[x])) > PRECISION){ 29 | err += 1; 30 | } 31 | } 32 | 33 | return err; 34 | } 35 | #endif 36 | 37 | int main(){ 38 | int failcode = 0; 39 | int failed; 40 | #ifndef T1 41 | failed = 0; 42 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 43 | failed = failed + test1(); 44 | } 45 | if (failed != 0){ 46 | failcode = failcode + (1 << 0); 47 | } 48 | #endif 49 | return failcode; 50 | } 51 | -------------------------------------------------------------------------------- /Tests/parallel_reduction.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:parallel,reduction,V:1.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = (real_t *)malloc(n * sizeof(real_t)); 8 | real_t reduction; 9 | 10 | for (int x = 0; x < n; ++x){ 11 | a[x] = rand() / (real_t)(RAND_MAX / 10); 12 | } 13 | 14 | #pragma acc parallel copyin(a[0:n]) reduction(+:reduction) 15 | { 16 | #pragma acc loop 17 | for (int x = 0; x < n; ++x){ 18 | reduction = reduction + a[x]; 19 | } 20 | } 21 | 22 | for (int x = 0; x < n; ++x){ 23 | reduction = reduction - a[x]; 24 | } 25 | if (fabs(reduction) > PRECISION){ 26 | err += 1; 27 | } 28 | 29 | return err; 30 | } 31 | #endif 32 | 33 | int main(){ 34 | int failcode = 0; 35 | int failed; 36 | #ifndef T1 37 | failed = 0; 38 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 39 | failed = failed + test1(); 40 | } 41 | if (failed != 0){ 42 | failcode = failcode + (1 << 0); 43 | } 44 | #endif 45 | return failcode; 46 | } 47 | -------------------------------------------------------------------------------- /Tests/parallel_reduction.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:parallel,reduction,V:1.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = new real_t[n]; 8 | real_t reduction; 9 | 10 | for (int x = 0; x < n; ++x){ 11 | a[x] = rand() / (real_t)(RAND_MAX / 10); 12 | } 13 | 14 | #pragma acc parallel copyin(a[0:n]) reduction(+:reduction) 15 | { 16 | #pragma acc loop 17 | for (int x = 0; x < n; ++x){ 18 | reduction = reduction + a[x]; 19 | } 20 | } 21 | 22 | for (int x = 0; x < n; ++x){ 23 | reduction = reduction - a[x]; 24 | } 25 | if (fabs(reduction) > PRECISION){ 26 | err += 1; 27 | } 28 | 29 | return err; 30 | } 31 | #endif 32 | 33 | int main(){ 34 | int failcode = 0; 35 | int failed; 36 | #ifndef T1 37 | failed = 0; 38 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 39 | failed = failed + test1(); 40 | } 41 | if (failed != 0){ 42 | failcode = failcode + (1 << 0); 43 | } 44 | #endif 45 | return failcode; 46 | } 47 | -------------------------------------------------------------------------------- /Tests/parallel_scalar_default_firstprivate.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:parallel,data,data-region,default-mapping,V:2.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = new real_t[n]; 8 | real_t * b = new real_t[n]; 9 | real_t scalar = rand() / (real_t)(RAND_MAX / 10); 10 | real_t scalar_copy = scalar; 11 | 12 | for (int x = 0; x < n; ++x){ 13 | a[x] = rand() / (real_t)(RAND_MAX / 10); 14 | b[x] = 0.0; 15 | } 16 | 17 | #pragma acc data copyin(a[0:n]) copyout(b[0:n]) 18 | { 19 | #pragma acc parallel 20 | { 21 | #pragma acc loop 22 | for (int x = 0; x < n; ++x){ 23 | b[x] = a[x] + scalar; 24 | } 25 | } 26 | } 27 | 28 | for (int x = 0; x < n; ++x){ 29 | if (fabs(b[x] - (a[x] + scalar_copy)) > PRECISION){ 30 | err += 1; 31 | } 32 | } 33 | if (fabs(scalar_copy - scalar) > PRECISION){ 34 | err += 1; 35 | } 36 | 37 | return err; 38 | } 39 | #endif 40 | 41 | int main(){ 42 | int failcode = 0; 43 | int failed; 44 | #ifndef T1 45 | failed = 0; 46 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 47 | failed = failed + test1(); 48 | } 49 | if (failed != 0){ 50 | failcode = failcode + (1 << 0); 51 | } 52 | #endif 53 | return failcode; 54 | } 55 | -------------------------------------------------------------------------------- /Tests/parallel_wait.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:parallel,wait,async,V:2.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t *a = (real_t *)malloc(n * sizeof(real_t)); 8 | real_t *b = (real_t *)malloc(n * sizeof(real_t)); 9 | 10 | for (int x = 0; x < n; ++x){ 11 | a[x] = rand() / (real_t)(RAND_MAX / 10); 12 | b[x] = a[x]; 13 | } 14 | 15 | #pragma acc enter data create(a[0:n]) 16 | #pragma acc update device(a[0:n]) async(1) 17 | #pragma acc parallel present(a[0:n]) wait(1) 18 | { 19 | #pragma acc loop 20 | for (int x = 0; x < n; ++x){ 21 | a[x] += 1; 22 | } 23 | } 24 | #pragma acc exit data copyout(a[0:n]) 25 | for (int x = 0; x < n; ++x){ 26 | if (fabs(a[x] - (b[x] + 1)) > PRECISION){ 27 | err = 1; 28 | } 29 | } 30 | 31 | return err; 32 | } 33 | #endif 34 | 35 | int main(){ 36 | int failcode = 0; 37 | int failed; 38 | #ifndef T1 39 | failed = 0; 40 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 41 | failed = failed + test1(); 42 | } 43 | if (failed != 0){ 44 | failcode = failcode + (1 << 0); 45 | } 46 | #endif 47 | return failcode; 48 | } 49 | -------------------------------------------------------------------------------- /Tests/parallel_wait.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:parallel,wait,async,V:2.0-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t *a = new real_t[n]; 8 | real_t *b = new real_t[n]; 9 | 10 | for (int x = 0; x < n; ++x){ 11 | a[x] = rand() / (real_t)(RAND_MAX / 10); 12 | b[x] = a[x]; 13 | } 14 | 15 | #pragma acc enter data create(a[0:n]) 16 | #pragma acc update device(a[0:n]) async(1) 17 | #pragma acc parallel present(a[0:n]) wait(1) 18 | { 19 | #pragma acc loop 20 | for (int x = 0; x < n; ++x){ 21 | a[x] += 1; 22 | } 23 | } 24 | #pragma acc exit data copyout(a[0:n]) 25 | for (int x = 0; x < n; ++x){ 26 | if (fabs(a[x] - (b[x] + 1)) > PRECISION){ 27 | err = 1; 28 | } 29 | } 30 | 31 | return err; 32 | } 33 | #endif 34 | 35 | int main(){ 36 | int failcode = 0; 37 | int failed; 38 | #ifndef T1 39 | failed = 0; 40 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 41 | failed = failed + test1(); 42 | } 43 | if (failed != 0){ 44 | failcode = failcode + (1 << 0); 45 | } 46 | #endif 47 | return failcode; 48 | } 49 | -------------------------------------------------------------------------------- /Tests/parallel_wait_devnum.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:parallel,wait,async,V:2.0-3.2 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t *a = (real_t *)malloc(n * sizeof(real_t)); 8 | real_t *b = (real_t *)malloc(n * sizeof(real_t)); 9 | 10 | for (int x = 0; x < n; ++x){ 11 | a[x] = rand() / (real_t)(RAND_MAX / 10); 12 | b[x] = 0.0; 13 | } 14 | 15 | #pragma acc data copyin(a[0:n], b[0:n]) 16 | { 17 | #pragma acc parallel loop present(a[0:n], b[0:n]) async(1) 18 | for (int x = 0; x < n; ++x){ 19 | b[x] = a[x]; 20 | } 21 | #pragma acc update host(b[0:n]) wait(1) 22 | } 23 | for (int x = 0; x < n; ++x){ 24 | if (fabs(a[x] - b[x]) > PRECISION){ 25 | err += 1; 26 | } 27 | } 28 | 29 | return err; 30 | } 31 | #endif 32 | 33 | int main(){ 34 | int failcode = 0; 35 | int failed; 36 | #ifndef T1 37 | failed = 0; 38 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 39 | failed += test1(); 40 | } 41 | if (failed){ 42 | failcode += (1 << 0); 43 | } 44 | #endif 45 | return failcode; 46 | } 47 | -------------------------------------------------------------------------------- /Tests/parallel_wait_devnum.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:parallel,wait,async,V:2.0-3.2 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t *a = new real_t[n]; 8 | real_t *b = new real_t[n]; 9 | 10 | for (int x = 0; x < n; ++x){ 11 | a[x] = rand() / (real_t)(RAND_MAX / 10); 12 | b[x] = 0.0; 13 | } 14 | 15 | #pragma acc data copyin(a[0:n], b[0:n]) 16 | { 17 | #pragma acc parallel loop present(a[0:n], b[0:n]) async(1) 18 | for (int x = 0; x < n; ++x){ 19 | b[x] = a[x]; 20 | } 21 | #pragma acc update host(b[0:n]) wait(1) 22 | } 23 | for (int x = 0; x < n; ++x){ 24 | if (fabs(a[x] - b[x]) > PRECISION){ 25 | err += 1; 26 | } 27 | } 28 | 29 | return err; 30 | } 31 | #endif 32 | 33 | int main(){ 34 | int failcode = 0; 35 | int failed; 36 | #ifndef T1 37 | failed = 0; 38 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 39 | failed += test1(); 40 | } 41 | if (failed){ 42 | failcode += (1 << 0); 43 | } 44 | #endif 45 | return failcode; 46 | } 47 | -------------------------------------------------------------------------------- /Tests/reference_count_zero.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:reference-counting,data,V:3.2-3.3 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = (real_t *)malloc(n * sizeof(real_t)); 8 | real_t * b = (real_t *)malloc(n * sizeof(real_t)); 9 | real_t * c = (real_t *)malloc(n * sizeof(real_t)); 10 | 11 | for (int x = 0; x < n; ++x){ 12 | a[x] = rand() / (real_t)(RAND_MAX / 10); 13 | b[x] = rand() / (real_t)(RAND_MAX / 10); 14 | c[x] = 0.0; 15 | } 16 | 17 | 18 | #pragma acc data copy(a[0:n], b[0:n], c[0:n]) 19 | { 20 | #pragma acc parallel loop 21 | for (int x = 0; x < n; ++x){ 22 | c[x] = a[x] + b[x]; 23 | } 24 | } 25 | 26 | #pragma acc exit data copyout(c[0:n]) 27 | 28 | for (int x = 0; x < n; ++x){ 29 | if (fabs(c[x] - (a[x] + b[x])) > PRECISION){ 30 | err += 1; 31 | } 32 | } 33 | 34 | return err; 35 | } 36 | #endif 37 | 38 | int main(){ 39 | int failcode = 0; 40 | int failed; 41 | #ifndef T1 42 | failed = 0; 43 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 44 | failed = failed + test1(); 45 | } 46 | if (failed != 0){ 47 | failcode = failcode + (1 << 0); 48 | } 49 | #endif 50 | return failcode; 51 | } 52 | 53 | -------------------------------------------------------------------------------- /Tests/reference_count_zero.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:reference-counting,data,V:3.2-3.3 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = new real_t[n]; 8 | real_t * b = new real_t[n]; 9 | real_t * c = new real_t[n]; 10 | 11 | for (int x = 0; x < n; ++x){ 12 | a[x] = rand() / (real_t)(RAND_MAX / 10); 13 | b[x] = rand() / (real_t)(RAND_MAX / 10); 14 | c[x] = 0.0; 15 | } 16 | 17 | 18 | #pragma acc data copy(a[0:n], b[0:n], c[0:n]) 19 | { 20 | #pragma acc parallel loop 21 | for (int x = 0; x < n; ++x){ 22 | c[x] = a[x] + b[x]; 23 | } 24 | } 25 | 26 | #pragma acc exit data copyout(c[0:n]) 27 | 28 | for (int x = 0; x < n; ++x){ 29 | if (fabs(c[x] - (a[x] + b[x])) > PRECISION){ 30 | err += 1; 31 | } 32 | } 33 | 34 | return err; 35 | } 36 | #endif 37 | 38 | int main(){ 39 | int failcode = 0; 40 | int failed; 41 | #ifndef T1 42 | failed = 0; 43 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 44 | failed = failed + test1(); 45 | } 46 | if (failed != 0){ 47 | failcode = failcode + (1 << 0); 48 | } 49 | #endif 50 | return failcode; 51 | } 52 | 53 | -------------------------------------------------------------------------------- /Tests/serial_copy.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:serial,data,data-region,V:2.6-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = (real_t *)malloc(n * sizeof(real_t)); 8 | real_t * a_host = (real_t *)malloc(n * sizeof(real_t)); 9 | 10 | for (int x = 0; x < n; ++x){ 11 | a[x] = rand() / (real_t)(RAND_MAX / 10); 12 | a_host[x] = a[x]; 13 | } 14 | 15 | #pragma acc serial copy(a[0:n]) 16 | { 17 | #pragma acc loop 18 | for (int x = 0; x < n; ++x){ 19 | a[x] = 2 * a[x]; 20 | } 21 | } 22 | 23 | for (int x = 0; x < n; ++x){ 24 | if (fabs(a[x] - (2 * a_host[x])) > PRECISION){ 25 | err = 1; 26 | } 27 | } 28 | 29 | return err; 30 | } 31 | #endif 32 | 33 | int main(){ 34 | int failcode = 0; 35 | int failed; 36 | #ifndef T1 37 | failed = 0; 38 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 39 | failed = failed + test1(); 40 | } 41 | if (failed != 0){ 42 | failcode = failcode + (1 << 0); 43 | } 44 | #endif 45 | return failcode; 46 | } 47 | -------------------------------------------------------------------------------- /Tests/serial_copy.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:serial,data,data-region,V:2.6-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = new real_t[n]; 8 | real_t * a_host = new real_t[n]; 9 | 10 | for (int x = 0; x < n; ++x){ 11 | a[x] = rand() / (real_t)(RAND_MAX / 10); 12 | a_host[x] = a[x]; 13 | } 14 | 15 | #pragma acc serial copy(a[0:n]) 16 | { 17 | #pragma acc loop 18 | for (int x = 0; x < n; ++x){ 19 | a[x] = 2 * a[x]; 20 | } 21 | } 22 | 23 | for (int x = 0; x < n; ++x){ 24 | if (fabs(a[x] - (2 * a_host[x])) > PRECISION){ 25 | err = 1; 26 | } 27 | } 28 | 29 | return err; 30 | } 31 | #endif 32 | 33 | int main(){ 34 | int failcode = 0; 35 | int failed; 36 | #ifndef T1 37 | failed = 0; 38 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 39 | failed = failed + test1(); 40 | } 41 | if (failed != 0){ 42 | failcode = failcode + (1 << 0); 43 | } 44 | #endif 45 | return failcode; 46 | } 47 | -------------------------------------------------------------------------------- /Tests/serial_create.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:serial,data,data-region,V:2.6-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = new real_t[n]; 8 | real_t * b = new real_t[n]; 9 | real_t * c = new real_t[n]; 10 | 11 | for (int x = 0; x < n; ++x){ 12 | a[x] = rand() / (real_t)(RAND_MAX / 10); 13 | b[x] = 0.0; 14 | c[x] = 0.0; 15 | } 16 | 17 | #pragma acc data copyin(a[0:n]) copy(c[0:n]) 18 | { 19 | #pragma acc serial create(b[0:n]) 20 | { 21 | #pragma acc loop 22 | for (int x = 0; x < n; ++x){ 23 | b[x] = a[x]; 24 | } 25 | #pragma acc loop 26 | for (int x = 0; x < n; ++x){ 27 | c[x] = b[x]; 28 | } 29 | } 30 | } 31 | 32 | for (int x = 0; x < n; ++x){ 33 | if (fabs(a[x] - c[x]) > PRECISION){ 34 | err = 1; 35 | } 36 | } 37 | 38 | return err; 39 | } 40 | #endif 41 | 42 | int main(){ 43 | int failcode = 0; 44 | int failed; 45 | #ifndef T1 46 | failed = 0; 47 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 48 | failed = failed + test1(); 49 | } 50 | if (failed != 0){ 51 | failcode = failcode + (1 << 0); 52 | } 53 | #endif 54 | return failcode; 55 | } 56 | -------------------------------------------------------------------------------- /Tests/serial_create_zero.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:serial,data,data-region,V:3.0-3.2 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = (real_t *)malloc(n * sizeof(real_t)); 8 | real_t * b = (real_t *)malloc(n * sizeof(real_t)); 9 | 10 | for (int x = 0; x < n; ++x){ 11 | a[x] = rand() / (real_t)(RAND_MAX / 10); 12 | b[x] = 1; 13 | } 14 | 15 | #pragma acc data copyin(a[0:n]) 16 | { 17 | #pragma acc serial create(zero: b[0:n]) copyout(b[0:n]) 18 | { 19 | #pragma acc loop 20 | for (int x = 0; x < n; ++x){ 21 | b[x] += a[x]; 22 | } 23 | } 24 | } 25 | 26 | for (int x = 0; x < n; ++x){ 27 | if (fabs(a[x] - b[x]) > PRECISION){ 28 | err = 1; 29 | } 30 | } 31 | 32 | return err; 33 | } 34 | #endif 35 | 36 | int main(){ 37 | int failcode = 0; 38 | int failed; 39 | #ifndef T1 40 | failed = 0; 41 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 42 | failed = failed + test1(); 43 | } 44 | if (failed != 0){ 45 | failcode = failcode + (1 << 0); 46 | } 47 | #endif 48 | return failcode; 49 | } 50 | -------------------------------------------------------------------------------- /Tests/serial_create_zero.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:serial,data,data-region,V:3.0-3.2 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = new real_t[n]; 8 | real_t * b = new real_t[n]; 9 | 10 | for (int x = 0; x < n; ++x){ 11 | a[x] = rand() / (real_t)(RAND_MAX / 10); 12 | b[x] = 1; 13 | } 14 | 15 | #pragma acc data copyin(a[0:n]) 16 | { 17 | #pragma acc serial create(zero: b[0:n]) copyout(b[0:n]) 18 | { 19 | #pragma acc loop 20 | for (int x = 0; x < n; ++x){ 21 | b[x] += a[x]; 22 | } 23 | } 24 | } 25 | 26 | for (int x = 0; x < n; ++x){ 27 | if (fabs(a[x] - b[x]) > PRECISION){ 28 | err = 1; 29 | } 30 | } 31 | 32 | return err; 33 | } 34 | #endif 35 | 36 | int main(){ 37 | int failcode = 0; 38 | int failed; 39 | #ifndef T1 40 | failed = 0; 41 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 42 | failed = failed + test1(); 43 | } 44 | if (failed != 0){ 45 | failcode = failcode + (1 << 0); 46 | } 47 | #endif 48 | return failcode; 49 | } 50 | -------------------------------------------------------------------------------- /Tests/serial_default_present.F90: -------------------------------------------------------------------------------- 1 | #ifndef T1 2 | !T1:serial,default,V:2.6-2.7 3 | LOGICAL FUNCTION test1() 4 | IMPLICIT NONE 5 | INCLUDE "acc_testsuite.Fh" 6 | INTEGER:: errors 7 | REAL(8),DIMENSION(LOOPCOUNT):: a 8 | INTEGER:: x 9 | errors = 0 10 | 11 | a = 0 12 | 13 | !$acc enter data copyin(a(1:LOOPCOUNT)) 14 | !$acc serial default(present) 15 | !$acc loop 16 | DO x = 1, LOOPCOUNT 17 | a(x) = 1 18 | END DO 19 | !$acc end serial 20 | !$acc exit data copyout(a(1:LOOPCOUNT)) 21 | 22 | DO x = 1, LOOPCOUNT 23 | IF (abs(a(x) - 1) .gt. PRECISION) THEN 24 | errors = errors + 1 25 | END IF 26 | END DO 27 | 28 | IF (errors .eq. 0) THEN 29 | test1 = .FALSE. 30 | ELSE 31 | test1 = .TRUE. 32 | END IF 33 | END 34 | #endif 35 | 36 | PROGRAM main 37 | IMPLICIT NONE 38 | INTEGER :: failcode, testrun 39 | LOGICAL :: failed 40 | INCLUDE "acc_testsuite.Fh" 41 | #ifndef T1 42 | LOGICAL :: test1 43 | #endif 44 | failed = .FALSE. 45 | failcode = 0 46 | #ifndef T1 47 | DO testrun = 1, NUM_TEST_CALLS 48 | failed = failed .or. test1() 49 | END DO 50 | IF (failed) THEN 51 | failcode = failcode + 2 ** 0 52 | failed = .FALSE. 53 | END IF 54 | #endif 55 | CALL EXIT (failcode) 56 | END PROGRAM 57 | -------------------------------------------------------------------------------- /Tests/serial_default_present.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:serial,data,data-region,default,V:2.6-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = (real_t *)malloc(n * sizeof(real_t)); 8 | 9 | for (int x = 0; x < n; ++x){ 10 | a[x] = 0.0; 11 | } 12 | #pragma acc enter data copyin(a[0:n]) 13 | #pragma acc serial default(present) 14 | { 15 | #pragma acc loop 16 | for (int x = 0; x < n; ++x){ 17 | a[x] = 1.0; 18 | } 19 | } 20 | #pragma acc exit data copyout(a[0:n]) 21 | 22 | for (int x = 0; x < n; ++x){ 23 | if (fabs(a[x] - 1.0) > PRECISION){ 24 | err = 1; 25 | } 26 | } 27 | 28 | return err; 29 | } 30 | #endif 31 | 32 | int main(){ 33 | int failcode = 0; 34 | int failed; 35 | #ifndef T1 36 | failed = 0; 37 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 38 | failed = failed + test1(); 39 | } 40 | if (failed != 0){ 41 | failcode = failcode + (1 << 0); 42 | } 43 | #endif 44 | return failcode; 45 | } 46 | -------------------------------------------------------------------------------- /Tests/serial_default_present.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:serial,data,data-region,default,V:2.6-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = new real_t[n]; 8 | 9 | for (int x = 0; x < n; ++x){ 10 | a[x] = 0.0; 11 | } 12 | #pragma acc enter data copyin(a[0:n]) 13 | #pragma acc serial default(present) 14 | { 15 | #pragma acc loop 16 | for (int x = 0; x < n; ++x){ 17 | a[x] = 1.0; 18 | } 19 | } 20 | #pragma acc exit data copyout(a[0:n]) 21 | 22 | for (int x = 0; x < n; ++x){ 23 | if (fabs(a[x] - 1.0) > PRECISION){ 24 | err = 1; 25 | } 26 | } 27 | 28 | return err; 29 | } 30 | #endif 31 | 32 | int main(){ 33 | int failcode = 0; 34 | int failed; 35 | #ifndef T1 36 | failed = 0; 37 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 38 | failed = failed + test1(); 39 | } 40 | if (failed != 0){ 41 | failcode = failcode + (1 << 0); 42 | } 43 | #endif 44 | return failcode; 45 | } 46 | -------------------------------------------------------------------------------- /Tests/serial_loop_gang.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:serial,loop,combined-constructs,V:2.6-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = (real_t *)malloc(n * sizeof(real_t)); 8 | real_t * b = (real_t *)malloc(n * sizeof(real_t)); 9 | real_t * c = (real_t *)malloc(n * sizeof(real_t)); 10 | 11 | for (int x = 0; x < n; ++x){ 12 | a[x] = rand() / (real_t)(RAND_MAX / 10); 13 | b[x] = rand() / (real_t)(RAND_MAX / 10); 14 | c[x] = 0.0; 15 | } 16 | 17 | #pragma acc data copyin(a[0:n], b[0:n]) copy(c[0:n]) 18 | { 19 | #pragma acc serial loop gang 20 | for (int x = 0; x < n; ++x){ 21 | c[x] = a[x] + b[x]; 22 | } 23 | } 24 | 25 | for (int x = 0; x < n; ++x){ 26 | if (fabs(c[x] - (a[x] + b[x])) > PRECISION){ 27 | err = 1; 28 | } 29 | } 30 | 31 | return err; 32 | } 33 | #endif 34 | 35 | int main(){ 36 | int failcode = 0; 37 | int failed; 38 | #ifndef T1 39 | failed = 0; 40 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 41 | failed = failed + test1(); 42 | } 43 | if (failed != 0){ 44 | failcode = failcode + (1 << 0); 45 | } 46 | #endif 47 | return failcode; 48 | } 49 | -------------------------------------------------------------------------------- /Tests/serial_loop_gang.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:serial,loop,combined-constructs,V:2.6-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = new real_t[n]; 8 | real_t * b = new real_t[n]; 9 | real_t * c = new real_t[n]; 10 | 11 | for (int x = 0; x < n; ++x){ 12 | a[x] = rand() / (real_t)(RAND_MAX / 10); 13 | b[x] = rand() / (real_t)(RAND_MAX / 10); 14 | c[x] = 0.0; 15 | } 16 | 17 | #pragma acc data copyin(a[0:n], b[0:n]) copy(c[0:n]) 18 | { 19 | #pragma acc serial loop gang 20 | for (int x = 0; x < n; ++x){ 21 | c[x] = a[x] + b[x]; 22 | } 23 | } 24 | 25 | for (int x = 0; x < n; ++x){ 26 | if (fabs(c[x] - (a[x] + b[x])) > PRECISION){ 27 | err = 1; 28 | } 29 | } 30 | 31 | return err; 32 | } 33 | #endif 34 | 35 | int main(){ 36 | int failcode = 0; 37 | int failed; 38 | #ifndef T1 39 | failed = 0; 40 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 41 | failed = failed + test1(); 42 | } 43 | if (failed != 0){ 44 | failcode = failcode + (1 << 0); 45 | } 46 | #endif 47 | return failcode; 48 | } 49 | -------------------------------------------------------------------------------- /Tests/serial_loop_reduction_add_general.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:serial,loop,reduction,combined-constructs,V:2.6-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = (real_t *)malloc(n * sizeof(real_t)); 8 | real_t * b = (real_t *)malloc(n * sizeof(real_t)); 9 | real_t total = 10; 10 | 11 | for (int x = 0; x < n; ++x){ 12 | a[x] = rand() / (real_t)(RAND_MAX / 10); 13 | b[x] = rand() / (real_t)(RAND_MAX / 10); 14 | } 15 | 16 | #pragma acc data copyin(a[0:n], b[0:n]) 17 | { 18 | #pragma acc serial loop reduction(+:total) 19 | for (int x = 0; x < n; ++x){ 20 | total += a[x] + b[x]; 21 | } 22 | } 23 | for (int x = 0; x < n; ++x){ 24 | total -= a[x] + b[x]; 25 | } 26 | if (fabs(total - 10) > PRECISION * (2 * n - 1)){ //199 = # of mathematical operations necessary 27 | err = 1; 28 | } 29 | 30 | return err; 31 | } 32 | #endif 33 | 34 | int main(){ 35 | int failcode = 0; 36 | int failed; 37 | #ifndef T1 38 | failed = 0; 39 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 40 | failed = failed + test1(); 41 | } 42 | if (failed != 0){ 43 | failcode = failcode + (1 << 0); 44 | } 45 | #endif 46 | return failcode; 47 | } 48 | -------------------------------------------------------------------------------- /Tests/serial_loop_reduction_add_general.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:serial,loop,reduction,combined-constructs,V:2.6-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = new real_t[n]; 8 | real_t * b = new real_t[n]; 9 | real_t total = 10; 10 | 11 | for (int x = 0; x < n; ++x){ 12 | a[x] = rand() / (real_t)(RAND_MAX / 10); 13 | b[x] = rand() / (real_t)(RAND_MAX / 10); 14 | } 15 | 16 | #pragma acc data copyin(a[0:n], b[0:n]) 17 | { 18 | #pragma acc serial loop reduction(+:total) 19 | for (int x = 0; x < n; ++x){ 20 | total += a[x] + b[x]; 21 | } 22 | } 23 | for (int x = 0; x < n; ++x){ 24 | total -= a[x] + b[x]; 25 | } 26 | if (fabs(total - 10) > PRECISION * (2 * n - 1)){ //199 = # of mathematical operations necessary 27 | err = 1; 28 | } 29 | 30 | return err; 31 | } 32 | #endif 33 | 34 | int main(){ 35 | int failcode = 0; 36 | int failed; 37 | #ifndef T1 38 | failed = 0; 39 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 40 | failed = failed + test1(); 41 | } 42 | if (failed != 0){ 43 | failcode = failcode + (1 << 0); 44 | } 45 | #endif 46 | return failcode; 47 | } 48 | -------------------------------------------------------------------------------- /Tests/serial_loop_reduction_and_general.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:serial,loop,reduction,combined-constructs,V:2.6-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | char * a = (char *)malloc(n * sizeof(char)); 8 | real_t false_margin = pow(exp(1), log(.5)/n); 9 | char result = 1; 10 | char found = 0; 11 | 12 | for (int x = 0; x < n; ++x){ 13 | if(rand() / (real_t)(RAND_MAX) < false_margin){ 14 | a[x] = 1; 15 | } 16 | else{ 17 | a[x] = 0; 18 | } 19 | } 20 | 21 | #pragma acc data copyin(a[0:n]) 22 | { 23 | #pragma acc serial loop reduction(&&:result) 24 | for (int x = 0; x < n; ++x){ 25 | result = result && a[x]; 26 | } 27 | } 28 | 29 | for (int x = 0; x < n; ++x){ 30 | if (a[x] == 0){ 31 | found = 1; 32 | break; 33 | } 34 | } 35 | if (found == result){ 36 | err = 1; 37 | } 38 | 39 | return err; 40 | } 41 | #endif 42 | 43 | int main(){ 44 | int failcode = 0; 45 | int failed; 46 | #ifndef T1 47 | failed = 0; 48 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 49 | failed = failed + test1(); 50 | } 51 | if (failed != 0){ 52 | failcode = failcode + (1 << 0); 53 | } 54 | #endif 55 | return failcode; 56 | } 57 | -------------------------------------------------------------------------------- /Tests/serial_loop_reduction_and_general.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:serial,loop,reduction,combined-constructs,V:2.6-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | char * a = new char[n]; 8 | real_t false_margin = pow(exp(1), log(.5)/n); 9 | char result = 1; 10 | char found = 0; 11 | 12 | for (int x = 0; x < n; ++x){ 13 | if(rand() / (real_t)(RAND_MAX) < false_margin){ 14 | a[x] = 1; 15 | } 16 | else{ 17 | a[x] = 0; 18 | } 19 | } 20 | 21 | #pragma acc data copyin(a[0:n]) 22 | { 23 | #pragma acc serial loop reduction(&&:result) 24 | for (int x = 0; x < n; ++x){ 25 | result = result && a[x]; 26 | } 27 | } 28 | 29 | for (int x = 0; x < n; ++x){ 30 | if (a[x] == 0){ 31 | found = 1; 32 | break; 33 | } 34 | } 35 | if (found == result){ 36 | err = 1; 37 | } 38 | 39 | return err; 40 | } 41 | #endif 42 | 43 | int main(){ 44 | int failcode = 0; 45 | int failed; 46 | #ifndef T1 47 | failed = 0; 48 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 49 | failed = failed + test1(); 50 | } 51 | if (failed != 0){ 52 | failcode = failcode + (1 << 0); 53 | } 54 | #endif 55 | return failcode; 56 | } 57 | -------------------------------------------------------------------------------- /Tests/serial_loop_reduction_bitxor_general.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:serial,loop,reduction,combined-constructs,V:2.6-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | unsigned int * a = (unsigned int *)malloc(n * sizeof(unsigned int)); 8 | unsigned int host_b; 9 | unsigned int b = 0; 10 | 11 | for (int x = 0; x < n; ++x){ 12 | a[x] = (unsigned int) rand() / (real_t) (RAND_MAX / 2); 13 | } 14 | 15 | #pragma acc data copyin(a[0:n]) 16 | { 17 | #pragma acc serial loop reduction(^:b) 18 | for (int x = 0; x < n; ++x){ 19 | b = b ^ a[x]; 20 | } 21 | } 22 | 23 | host_b = a[0]; 24 | 25 | for (int x = 1; x < n; ++x){ 26 | host_b = host_b ^ a[x]; 27 | } 28 | if (b != host_b){ 29 | err = 1; 30 | } 31 | 32 | return err; 33 | } 34 | #endif 35 | 36 | int main(){ 37 | int failcode = 0; 38 | int failed; 39 | #ifndef T1 40 | failed = 0; 41 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 42 | failed = failed + test1(); 43 | } 44 | if (failed != 0){ 45 | failcode = failcode + (1 << 0); 46 | } 47 | #endif 48 | return failcode; 49 | } 50 | -------------------------------------------------------------------------------- /Tests/serial_loop_reduction_bitxor_general.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:serial,loop,reduction,combined-constructs,V:2.6-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | unsigned int * a = (unsigned int *)malloc(n * sizeof(unsigned int)); 8 | unsigned int host_b; 9 | unsigned int b = 0; 10 | 11 | for (int x = 0; x < n; ++x){ 12 | a[x] = (unsigned int) rand() / (real_t) (RAND_MAX / 2); 13 | } 14 | 15 | #pragma acc data copyin(a[0:n]) 16 | { 17 | #pragma acc serial loop reduction(^:b) 18 | for (int x = 0; x < n; ++x){ 19 | b = b ^ a[x]; 20 | } 21 | } 22 | 23 | host_b = a[0]; 24 | 25 | for (int x = 1; x < n; ++x){ 26 | host_b = host_b ^ a[x]; 27 | } 28 | if (b != host_b){ 29 | err = 1; 30 | } 31 | 32 | return err; 33 | } 34 | #endif 35 | 36 | int main(){ 37 | int failcode = 0; 38 | int failed; 39 | #ifndef T1 40 | failed = 0; 41 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 42 | failed = failed + test1(); 43 | } 44 | if (failed != 0){ 45 | failcode = failcode + (1 << 0); 46 | } 47 | #endif 48 | return failcode; 49 | } 50 | -------------------------------------------------------------------------------- /Tests/serial_loop_reduction_max_general.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:serial,loop,reduction,combined-constructs,V:2.6-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = new real_t[n]; 8 | real_t * b = new real_t[n]; 9 | real_t max = 0.0; 10 | int found = 0; 11 | 12 | for (int x = 0; x < n; ++x){ 13 | a[x] = rand() / (real_t)(RAND_MAX/10); 14 | b[x] = rand() / (real_t)(RAND_MAX/10); 15 | } 16 | #pragma acc data copyin(a[0:n], b[0:n]) copy(max) 17 | { 18 | #pragma acc serial loop reduction(max:max) 19 | for (int x = 0; x < n; ++x){ 20 | max = fmax(a[x] * b[x], max); 21 | } 22 | } 23 | 24 | for (int x = 0; x < n; ++x){ 25 | if (fabs(max - (a[x] * b[x] + PRECISION)) < 0){ 26 | err = 1; 27 | } 28 | if (fabs(max - (a[x] * b[x] - PRECISION)) > 0){ 29 | found = 1; 30 | } 31 | } 32 | if (found = 0){ 33 | err = 1; 34 | } 35 | 36 | return err; 37 | } 38 | #endif 39 | 40 | int main(){ 41 | int failcode = 0; 42 | int failed; 43 | #ifndef T1 44 | failed = 0; 45 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 46 | failed = failed + test1(); 47 | } 48 | if (failed != 0){ 49 | failcode = failcode + (1 << 0); 50 | } 51 | #endif 52 | return failcode; 53 | } 54 | -------------------------------------------------------------------------------- /Tests/serial_loop_reduction_or_general.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:serial,loop,reduction,combined-constructs,V:2.6-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | char * a = (char *)malloc(n * sizeof(char)); 8 | real_t false_margin = pow(exp(1), log(.5)/n); 9 | char result = 0; 10 | char found = 0; 11 | 12 | for (int x = 0; x < n; ++x){ 13 | if(rand() / (real_t)(RAND_MAX) > false_margin){ 14 | a[x] = 1; 15 | } 16 | else{ 17 | a[x] = 0; 18 | } 19 | } 20 | 21 | 22 | #pragma acc data copyin(a[0:n]) 23 | { 24 | #pragma acc serial loop reduction(||:result) 25 | for (int x = 0; x < n; ++x){ 26 | result = result || a[x]; 27 | } 28 | } 29 | 30 | for (int x = 0; x < n; ++x){ 31 | if (a[x] == 1){ 32 | found = 1; 33 | } 34 | } 35 | if (found != result){ 36 | err = 1; 37 | } 38 | 39 | return err; 40 | } 41 | #endif 42 | 43 | int main(){ 44 | int failcode = 0; 45 | int failed; 46 | #ifndef T1 47 | failed = 0; 48 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 49 | failed = failed + test1(); 50 | } 51 | if (failed != 0){ 52 | failcode = failcode + (1 << 0); 53 | } 54 | #endif 55 | return failcode; 56 | } 57 | -------------------------------------------------------------------------------- /Tests/serial_loop_reduction_or_general.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:serial,loop,reduction,combined-constructs,V:2.6-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | char * a = new char[n]; 8 | real_t false_margin = pow(exp(1), log(.5)/n); 9 | char result = 0; 10 | char found = 0; 11 | 12 | for (int x = 0; x < n; ++x){ 13 | if(rand() / (real_t)(RAND_MAX) > false_margin){ 14 | a[x] = 1; 15 | } 16 | else{ 17 | a[x] = 0; 18 | } 19 | } 20 | 21 | 22 | #pragma acc data copyin(a[0:n]) 23 | { 24 | #pragma acc serial loop reduction(||:result) 25 | for (int x = 0; x < n; ++x){ 26 | result = result || a[x]; 27 | } 28 | } 29 | 30 | for (int x = 0; x < n; ++x){ 31 | if (a[x] == 1){ 32 | found = 1; 33 | } 34 | } 35 | if (found != result){ 36 | err = 1; 37 | } 38 | 39 | return err; 40 | } 41 | #endif 42 | 43 | int main(){ 44 | int failcode = 0; 45 | int failed; 46 | #ifndef T1 47 | failed = 0; 48 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 49 | failed = failed + test1(); 50 | } 51 | if (failed != 0){ 52 | failcode = failcode + (1 << 0); 53 | } 54 | #endif 55 | return failcode; 56 | } 57 | -------------------------------------------------------------------------------- /Tests/serial_loop_seq.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:serial,loop,combined-constructs,V:2.6-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = (real_t *)malloc(n * sizeof(real_t)); 8 | real_t * b = (real_t *)malloc(n * sizeof(real_t)); 9 | real_t temp = 0.0; 10 | 11 | for (int x = 0; x < n; ++x){ 12 | a[x] = rand() / (real_t)(RAND_MAX / 10); 13 | b[x] = 0.0; 14 | } 15 | 16 | #pragma acc data copyin(a[0:n]) copy(b[0:n]) 17 | { 18 | #pragma acc serial loop seq 19 | for (int x = 1; x < n; ++x){ 20 | b[x] = b[x-1] + a[x]; 21 | } 22 | } 23 | 24 | for (int x = 1; x < n; ++x){ 25 | temp += a[x]; 26 | if (fabs(b[x] - temp) > PRECISION){ 27 | err = 1; 28 | } 29 | } 30 | 31 | return err; 32 | } 33 | #endif 34 | 35 | int main(){ 36 | int failcode = 0; 37 | int failed; 38 | #ifndef T1 39 | failed = 0; 40 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 41 | failed = failed + test1(); 42 | } 43 | if (failed != 0){ 44 | failcode = failcode + (1 << 0); 45 | } 46 | #endif 47 | return failcode; 48 | } 49 | -------------------------------------------------------------------------------- /Tests/serial_loop_seq.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:serial,loop,combined-constructs,V:2.6-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = new real_t[n]; 8 | real_t * b = new real_t[n]; 9 | real_t temp = 0.0; 10 | 11 | for (int x = 0; x < n; ++x){ 12 | a[x] = rand() / (real_t)(RAND_MAX / 10); 13 | b[x] = 0.0; 14 | } 15 | 16 | #pragma acc data copyin(a[0:n]) copy(b[0:n]) 17 | { 18 | #pragma acc serial loop seq 19 | for (int x = 1; x < n; ++x){ 20 | b[x] = b[x-1] + a[x]; 21 | } 22 | } 23 | 24 | for (int x = 1; x < n; ++x){ 25 | temp += a[x]; 26 | if (fabs(b[x] - temp) > PRECISION){ 27 | err = 1; 28 | } 29 | } 30 | 31 | return err; 32 | } 33 | #endif 34 | 35 | int main(){ 36 | int failcode = 0; 37 | int failed; 38 | #ifndef T1 39 | failed = 0; 40 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 41 | failed = failed + test1(); 42 | } 43 | if (failed != 0){ 44 | failcode = failcode + (1 << 0); 45 | } 46 | #endif 47 | return failcode; 48 | } 49 | -------------------------------------------------------------------------------- /Tests/serial_loop_vector.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:serial,loop,combined-constructs,V:2.6-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = (real_t *)malloc(n * sizeof(real_t)); 8 | real_t * b = (real_t *)malloc(n * sizeof(real_t)); 9 | real_t * c = (real_t *)malloc(n * sizeof(real_t)); 10 | 11 | for (int x = 0; x < n; ++x){ 12 | a[x] = rand() / (real_t)(RAND_MAX / 10); 13 | b[x] = rand() / (real_t)(RAND_MAX / 10); 14 | c[x] = 0.0; 15 | } 16 | 17 | #pragma acc data copyin(a[0:n], b[0:n]) copy(c[0:n]) 18 | { 19 | #pragma acc serial loop vector 20 | for (int x = 0; x < n; ++x){ 21 | c[x] = a[x] + b[x]; 22 | } 23 | } 24 | 25 | for (int x = 0; x < n; ++x){ 26 | if(fabs(c[x] - (a[x] + b[x])) > PRECISION){ 27 | err = 1; 28 | } 29 | } 30 | 31 | return err; 32 | } 33 | #endif 34 | 35 | int main(){ 36 | int failcode = 0; 37 | int failed; 38 | #ifndef T1 39 | failed = 0; 40 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 41 | failed = failed + test1(); 42 | } 43 | if (failed != 0){ 44 | failcode = failcode + (1 << 0); 45 | } 46 | #endif 47 | return failcode; 48 | } 49 | -------------------------------------------------------------------------------- /Tests/serial_loop_vector.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:serial,loop,combined-constructs,V:2.6-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = new real_t[n]; 8 | real_t * b = new real_t[n]; 9 | real_t * c = new real_t[n]; 10 | 11 | for (int x = 0; x < n; ++x){ 12 | a[x] = rand() / (real_t)(RAND_MAX / 10); 13 | b[x] = rand() / (real_t)(RAND_MAX / 10); 14 | c[x] = 0.0; 15 | } 16 | 17 | #pragma acc data copyin(a[0:n], b[0:n]) copy(c[0:n]) 18 | { 19 | #pragma acc serial loop vector 20 | for (int x = 0; x < n; ++x){ 21 | c[x] = a[x] + b[x]; 22 | } 23 | } 24 | 25 | for (int x = 0; x < n; ++x){ 26 | if(fabs(c[x] - (a[x] + b[x])) > PRECISION){ 27 | err = 1; 28 | } 29 | } 30 | 31 | return err; 32 | } 33 | #endif 34 | 35 | int main(){ 36 | int failcode = 0; 37 | int failed; 38 | #ifndef T1 39 | failed = 0; 40 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 41 | failed = failed + test1(); 42 | } 43 | if (failed != 0){ 44 | failcode = failcode + (1 << 0); 45 | } 46 | #endif 47 | return failcode; 48 | } 49 | -------------------------------------------------------------------------------- /Tests/serial_loop_worker.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:serial,loop,combined-constructs,V:2.6-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = (real_t *)malloc(n * sizeof(real_t)); 8 | real_t * b = (real_t *)malloc(n * sizeof(real_t)); 9 | real_t * c = (real_t *)malloc(n * sizeof(real_t)); 10 | 11 | for (int x = 0; x < n; ++x){ 12 | a[x] = rand() / (real_t)(RAND_MAX / 10); 13 | b[x] = rand() / (real_t)(RAND_MAX / 10); 14 | c[x] = 0.0; 15 | } 16 | 17 | #pragma acc data copyin(a[0:n], b[0:n]) copy(c[0:n]) 18 | { 19 | #pragma acc serial loop worker 20 | for (int x = 0; x < n; ++x){ 21 | c[x] = a[x] + b[x]; 22 | } 23 | } 24 | 25 | for (int x = 0; x < n; ++x){ 26 | if (fabs(c[x] - (a[x] + b[x])) > PRECISION){ 27 | err = 1; 28 | } 29 | } 30 | 31 | return err; 32 | } 33 | #endif 34 | 35 | int main(){ 36 | int failcode = 0; 37 | int failed; 38 | #ifndef T1 39 | failed = 0; 40 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 41 | failed = failed + test1(); 42 | } 43 | if (failed != 0){ 44 | failcode = failcode + (1 << 0); 45 | } 46 | #endif 47 | return failcode; 48 | } 49 | -------------------------------------------------------------------------------- /Tests/serial_loop_worker.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:serial,loop,combined-constructs,V:2.6-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = new real_t[n]; 8 | real_t * b = new real_t[n]; 9 | real_t * c = new real_t[n]; 10 | 11 | for (int x = 0; x < n; ++x){ 12 | a[x] = rand() / (real_t)(RAND_MAX / 10); 13 | b[x] = rand() / (real_t)(RAND_MAX / 10); 14 | c[x] = 0.0; 15 | } 16 | 17 | #pragma acc data copyin(a[0:n], b[0:n]) copy(c[0:n]) 18 | { 19 | #pragma acc serial loop worker 20 | for (int x = 0; x < n; ++x){ 21 | c[x] = a[x] + b[x]; 22 | } 23 | } 24 | 25 | for (int x = 0; x < n; ++x){ 26 | if (fabs(c[x] - (a[x] + b[x])) > PRECISION){ 27 | err = 1; 28 | } 29 | } 30 | 31 | return err; 32 | } 33 | #endif 34 | 35 | int main(){ 36 | int failcode = 0; 37 | int failed; 38 | #ifndef T1 39 | failed = 0; 40 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 41 | failed = failed + test1(); 42 | } 43 | if (failed != 0){ 44 | failcode = failcode + (1 << 0); 45 | } 46 | #endif 47 | return failcode; 48 | } 49 | -------------------------------------------------------------------------------- /Tests/serial_present.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:serial,present,V:2.6-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = (real_t *)malloc(n * sizeof(real_t)); 8 | real_t * b = (real_t *)malloc(n * sizeof(real_t)); 9 | real_t * c = (real_t *)malloc(n * sizeof(real_t)); 10 | 11 | for (int x = 0; x < n; ++x){ 12 | a[x] = rand() / (real_t)(RAND_MAX / 10); 13 | b[x] = rand() / (real_t)(RAND_MAX / 10); 14 | c[x] = 0.0; 15 | } 16 | 17 | #pragma acc enter data copyin(a[0:n], b[0:n]) 18 | #pragma acc serial present(a[0:n], b[0:n]) copy(c[0:n]) 19 | { 20 | #pragma acc loop 21 | for (int x = 0; x < n; ++x){ 22 | c[x] = a[x] + b[x]; 23 | } 24 | } 25 | #pragma acc exit data delete(a[0:n], b[0:n]) 26 | 27 | for (int x = 0; x < n; ++x){ 28 | if (fabs(c[x] - (a[x] + b[x])) > PRECISION){ 29 | err += 1; 30 | } 31 | } 32 | 33 | return err; 34 | } 35 | #endif 36 | 37 | int main(){ 38 | int failcode = 0; 39 | int failed; 40 | #ifndef T1 41 | failed = 0; 42 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 43 | failed = failed + test1(); 44 | } 45 | if (failed != 0){ 46 | failcode = failcode + (1 << 0); 47 | } 48 | #endif 49 | return failcode; 50 | } 51 | -------------------------------------------------------------------------------- /Tests/serial_present.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:serial,present,V:2.6-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = new real_t[n]; 8 | real_t * b = new real_t[n]; 9 | real_t * c = new real_t[n]; 10 | 11 | for (int x = 0; x < n; ++x){ 12 | a[x] = rand() / (real_t)(RAND_MAX / 10); 13 | b[x] = rand() / (real_t)(RAND_MAX / 10); 14 | c[x] = 0.0; 15 | } 16 | 17 | #pragma acc enter data copyin(a[0:n], b[0:n]) 18 | #pragma acc serial present(a[0:n], b[0:n]) copy(c[0:n]) 19 | { 20 | #pragma acc loop 21 | for (int x = 0; x < n; ++x){ 22 | c[x] = a[x] + b[x]; 23 | } 24 | } 25 | #pragma acc exit data delete(a[0:n], b[0:n]) 26 | 27 | for (int x = 0; x < n; ++x){ 28 | if (fabs(c[x] - (a[x] + b[x])) > PRECISION){ 29 | err += 1; 30 | } 31 | } 32 | 33 | return err; 34 | } 35 | #endif 36 | 37 | int main(){ 38 | int failcode = 0; 39 | int failed; 40 | #ifndef T1 41 | failed = 0; 42 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 43 | failed = failed + test1(); 44 | } 45 | if (failed != 0){ 46 | failcode = failcode + (1 << 0); 47 | } 48 | #endif 49 | return failcode; 50 | } 51 | -------------------------------------------------------------------------------- /Tests/serial_reduction.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:serial,reduction,V:2.6-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = (real_t *)malloc(n * sizeof(real_t)); 8 | real_t reduction; 9 | 10 | for (int x = 0; x < n; ++x){ 11 | a[x] = rand() / (real_t)(RAND_MAX / 10); 12 | } 13 | 14 | #pragma acc serial copyin(a[0:n]) reduction(+:reduction) 15 | { 16 | #pragma acc loop 17 | for (int x = 0; x < n; ++x){ 18 | reduction = reduction + a[x]; 19 | } 20 | } 21 | 22 | for (int x = 0; x < n; ++x){ 23 | reduction = reduction - a[x]; 24 | } 25 | if (fabs(reduction) > PRECISION){ 26 | err += 1; 27 | } 28 | 29 | return err; 30 | } 31 | #endif 32 | 33 | int main(){ 34 | int failcode = 0; 35 | int failed; 36 | #ifndef T1 37 | failed = 0; 38 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 39 | failed = failed + test1(); 40 | } 41 | if (failed != 0){ 42 | failcode = failcode + (1 << 0); 43 | } 44 | #endif 45 | return failcode; 46 | } 47 | -------------------------------------------------------------------------------- /Tests/serial_reduction.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:serial,reduction,V:2.6-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = new real_t[n]; 8 | real_t reduction; 9 | 10 | for (int x = 0; x < n; ++x){ 11 | a[x] = rand() / (real_t)(RAND_MAX / 10); 12 | } 13 | 14 | #pragma acc serial copyin(a[0:n]) reduction(+:reduction) 15 | { 16 | #pragma acc loop 17 | for (int x = 0; x < n; ++x){ 18 | reduction = reduction + a[x]; 19 | } 20 | } 21 | 22 | for (int x = 0; x < n; ++x){ 23 | reduction = reduction - a[x]; 24 | } 25 | if (fabs(reduction) > PRECISION){ 26 | err += 1; 27 | } 28 | 29 | return err; 30 | } 31 | #endif 32 | 33 | int main(){ 34 | int failcode = 0; 35 | int failed; 36 | #ifndef T1 37 | failed = 0; 38 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 39 | failed = failed + test1(); 40 | } 41 | if (failed != 0){ 42 | failcode = failcode + (1 << 0); 43 | } 44 | #endif 45 | return failcode; 46 | } 47 | -------------------------------------------------------------------------------- /Tests/serial_scalar_default_firstprivate.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:data,default-mapping,serial,firstprivate,V:2.6-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t * a = new real_t[n]; 8 | real_t * b = new real_t[n]; 9 | real_t scalar = rand() / (real_t)(RAND_MAX / 10); 10 | real_t scalar_copy = scalar; 11 | 12 | for (int x = 0; x < n; ++x){ 13 | a[x] = rand() / (real_t)(RAND_MAX / 10); 14 | b[x] = 0.0; 15 | } 16 | 17 | #pragma acc data copyin(a[0:n]) copyout(b[0:n]) 18 | { 19 | #pragma acc serial 20 | { 21 | #pragma acc loop 22 | for (int x = 0; x < n; ++x){ 23 | b[x] = a[x] + scalar; 24 | } 25 | } 26 | } 27 | 28 | for (int x = 0; x < n; ++x){ 29 | if (fabs(b[x] - (a[x] + scalar_copy)) > PRECISION){ 30 | err += 1; 31 | } 32 | } 33 | if (fabs(scalar_copy - scalar) > PRECISION){ 34 | err += 1; 35 | } 36 | 37 | return err; 38 | } 39 | #endif 40 | 41 | int main(){ 42 | int failcode = 0; 43 | int failed; 44 | #ifndef T1 45 | failed = 0; 46 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 47 | failed = failed + test1(); 48 | } 49 | if (failed != 0){ 50 | failcode = failcode + (1 << 0); 51 | } 52 | #endif 53 | return failcode; 54 | } 55 | -------------------------------------------------------------------------------- /Tests/serial_wait.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:serial,data,executable-data,async,wait,V:2.6-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t *a = (real_t *)malloc(n * sizeof(real_t)); 8 | real_t *b = (real_t *)malloc(n * sizeof(real_t)); 9 | 10 | for (int x = 0; x < n; ++x){ 11 | a[x] = rand() / (real_t)(RAND_MAX / 10); 12 | b[x] = a[x]; 13 | } 14 | 15 | #pragma acc enter data create(a[0:n]) 16 | #pragma acc update device(a[0:n]) async(1) 17 | #pragma acc serial present(a[0:n]) wait(1) 18 | { 19 | #pragma acc loop 20 | for (int x = 0; x < n; ++x){ 21 | a[x] += 1; 22 | } 23 | } 24 | #pragma acc exit data copyout(a[0:n]) 25 | for (int x = 0; x < n; ++x){ 26 | if (fabs(a[x] - (b[x] + 1)) > PRECISION){ 27 | err = 1; 28 | } 29 | } 30 | 31 | return err; 32 | } 33 | #endif 34 | 35 | int main(){ 36 | int failcode = 0; 37 | int failed; 38 | #ifndef T1 39 | failed = 0; 40 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 41 | failed = failed + test1(); 42 | } 43 | if (failed != 0){ 44 | failcode = failcode + (1 << 0); 45 | } 46 | #endif 47 | return failcode; 48 | } 49 | -------------------------------------------------------------------------------- /Tests/serial_wait.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:serial,data,executable-data,async,wait,V:2.6-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | real_t *a = new real_t[n]; 8 | real_t *b = new real_t[n]; 9 | 10 | for (int x = 0; x < n; ++x){ 11 | a[x] = rand() / (real_t)(RAND_MAX / 10); 12 | b[x] = a[x]; 13 | } 14 | 15 | #pragma acc enter data create(a[0:n]) 16 | #pragma acc update device(a[0:n]) async(1) 17 | #pragma acc serial present(a[0:n]) wait(1) 18 | { 19 | #pragma acc loop 20 | for (int x = 0; x < n; ++x){ 21 | a[x] += 1; 22 | } 23 | } 24 | #pragma acc exit data copyout(a[0:n]) 25 | for (int x = 0; x < n; ++x){ 26 | if (fabs(a[x] - (b[x] + 1)) > PRECISION){ 27 | err = 1; 28 | } 29 | } 30 | 31 | return err; 32 | } 33 | #endif 34 | 35 | int main(){ 36 | int failcode = 0; 37 | int failed; 38 | #ifndef T1 39 | failed = 0; 40 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 41 | failed = failed + test1(); 42 | } 43 | if (failed != 0){ 44 | failcode = failcode + (1 << 0); 45 | } 46 | #endif 47 | return failcode; 48 | } 49 | -------------------------------------------------------------------------------- /Tests/set_device_type_num_nvidia.F90: -------------------------------------------------------------------------------- 1 | #ifndef T1 2 | !T1:runtime,construct-independent,internal-control-values,set,nonvalidating,V:2.5-2.7 3 | LOGICAL FUNCTION test1() 4 | USE OPENACC 5 | IMPLICIT NONE 6 | INCLUDE "acc_testsuite.Fh" 7 | INTEGER :: device_num 8 | INTEGER :: device_type 9 | INTEGER :: errors = 0 10 | 11 | device_type = acc_get_device_type() 12 | device_num = acc_get_device_num(device_type) 13 | !$acc set device_type(nvidia) device_num(device_num) 14 | 15 | IF (errors .eq. 0) THEN 16 | test1 = .FALSE. 17 | ELSE 18 | test1 = .TRUE. 19 | END IF 20 | END 21 | #endif 22 | 23 | PROGRAM main 24 | IMPLICIT NONE 25 | INTEGER :: failcode, testrun 26 | LOGICAL :: failed 27 | INCLUDE "acc_testsuite.Fh" 28 | #ifndef T1 29 | LOGICAL :: test1 30 | #endif 31 | failed = .FALSE. 32 | failcode = 0 33 | #ifndef T1 34 | DO testrun = 1, NUM_TEST_CALLS 35 | failed = failed .or. test1() 36 | END DO 37 | IF (failed) THEN 38 | failcode = failcode + 2 ** 0 39 | failed = .FALSE. 40 | END IF 41 | #endif 42 | CALL EXIT (failcode) 43 | END PROGRAM 44 | -------------------------------------------------------------------------------- /Tests/set_device_type_num_nvidia.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:set,runtime,syntactic,V:2.5-3.2 4 | int test1(){ 5 | int err = 0; 6 | int device_num; 7 | 8 | device_num = acc_get_device_num(acc_get_device_type()); 9 | #pragma acc set device_type(nvidia) device_num(device_num) 10 | 11 | return err; 12 | } 13 | #endif 14 | 15 | int main(){ 16 | int failcode = 0; 17 | int failed; 18 | #ifndef T1 19 | failed = 0; 20 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 21 | failed = failed + test1(); 22 | } 23 | if (failed != 0){ 24 | failcode = failcode + (1 << 0); 25 | } 26 | #endif 27 | return failcode; 28 | } 29 | -------------------------------------------------------------------------------- /Tests/set_device_type_num_nvidia.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:set,runtime,syntactic,V:2.5-3.2 4 | int test1(){ 5 | int err = 0; 6 | int device_num; 7 | 8 | device_num = acc_get_device_num(acc_get_device_type()); 9 | #pragma acc set device_type(nvidia) device_num(device_num) 10 | 11 | return err; 12 | } 13 | #endif 14 | 15 | int main(){ 16 | int failcode = 0; 17 | int failed; 18 | #ifndef T1 19 | failed = 0; 20 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 21 | failed = failed + test1(); 22 | } 23 | if (failed != 0){ 24 | failcode = failcode + (1 << 0); 25 | } 26 | #endif 27 | return failcode; 28 | } 29 | -------------------------------------------------------------------------------- /Tests/set_device_type_nvidia.F90: -------------------------------------------------------------------------------- 1 | #ifndef T1 2 | !T1:runtime,construct-independent,internal-control-values,set,V:2.5-2.7 3 | LOGICAL FUNCTION test1() 4 | USE OPENACC 5 | IMPLICIT NONE 6 | INCLUDE "acc_testsuite.Fh" 7 | INTEGER :: errors = 0 8 | 9 | !$acc set device_type(nvidia) 10 | 11 | IF (errors .eq. 0) THEN 12 | test1 = .FALSE. 13 | ELSE 14 | test1 = .TRUE. 15 | END IF 16 | END 17 | #endif 18 | 19 | PROGRAM set_device_type 20 | IMPLICIT NONE 21 | INTEGER :: failcode, testrun 22 | LOGICAL :: failed 23 | INCLUDE "acc_testsuite.Fh" 24 | #ifndef T1 25 | LOGICAL :: test1 26 | #endif 27 | failed = .FALSE. 28 | failcode = 0 29 | #ifndef T1 30 | DO testrun = 1, NUM_TEST_CALLS 31 | failed = failed .or. test1() 32 | END DO 33 | IF (failed) THEN 34 | failcode = failcode + 2 ** 0 35 | failed = .FALSE. 36 | END IF 37 | #endif 38 | CALL EXIT (failcode) 39 | END PROGRAM 40 | -------------------------------------------------------------------------------- /Tests/set_device_type_nvidia.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:set,runtime,syntactic,V:2.5-3.2 4 | int test1(){ 5 | int err = 0; 6 | 7 | int device_type = acc_get_device_type(); 8 | 9 | #pragma acc set device_type(nvidia) 10 | if (acc_get_device_type() != device_type){ 11 | err += 1; 12 | } 13 | 14 | return err; 15 | } 16 | #endif 17 | 18 | int main(){ 19 | int failcode = 0; 20 | int failed; 21 | #ifndef T1 22 | failed = 0; 23 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 24 | failed = failed + test1(); 25 | } 26 | if (failed != 0){ 27 | failcode = failcode + (1 << 0); 28 | } 29 | #endif 30 | return failcode; 31 | } 32 | -------------------------------------------------------------------------------- /Tests/set_device_type_nvidia.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:set,runtime,syntactic,V:2.5-3.2 4 | int test1(){ 5 | int err = 0; 6 | 7 | int device_type = acc_get_device_type(); 8 | 9 | #pragma acc set device_type(nvidia) 10 | if (acc_get_device_type() != device_type){ 11 | err += 1; 12 | } 13 | 14 | return err; 15 | } 16 | #endif 17 | 18 | int main(){ 19 | int failcode = 0; 20 | int failed; 21 | #ifndef T1 22 | failed = 0; 23 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 24 | failed = failed + test1(); 25 | } 26 | if (failed != 0){ 27 | failcode = failcode + (1 << 0); 28 | } 29 | #endif 30 | return failcode; 31 | } 32 | -------------------------------------------------------------------------------- /Tests/set_if.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | 3 | #ifndef T1 4 | //T1:set,if,V:2.7-3.0 5 | int test1(){ 6 | int err = 0; 7 | srand(SEED); 8 | int device_type = acc_get_device_type(); 9 | 10 | #pragma acc set if(acc_get_device_type == device_type) 11 | 12 | return err; 13 | } 14 | #endif 15 | #ifndef T2 16 | //T2:set,if,V:2.7-3.0 17 | int test2(){ 18 | int err = 0; 19 | srand(SEED); 20 | int device_type = acc_get_device_type(); 21 | 22 | #pragma acc set if(acc_get_device_type != device_type) 23 | 24 | return err; 25 | } 26 | #endif 27 | 28 | int main(){ 29 | int failcode = 0; 30 | int failed; 31 | #ifndef T1 32 | failed = 0; 33 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 34 | failed = failed + test1(); 35 | } 36 | if (failed != 0){ 37 | failcode = failcode + (1 << 0); 38 | } 39 | #endif 40 | #ifndef T2 41 | failed = 0; 42 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 43 | failed = failed + test2(); 44 | } 45 | if (failed != 0){ 46 | failcode = failcode + (1 << 1); 47 | } 48 | #endif 49 | return failcode; 50 | } 51 | -------------------------------------------------------------------------------- /Tests/set_if.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | 3 | #ifndef T1 4 | //T1:set,if,V:2.7-3.0 5 | int test1(){ 6 | int err = 0; 7 | srand(SEED); 8 | int device_type = acc_get_device_type(); 9 | 10 | #pragma acc set if(acc_get_device_type == device_type) 11 | 12 | return err; 13 | } 14 | #endif 15 | #ifndef T2 16 | //T2:set,if,V:2.7-3.0 17 | int test2(){ 18 | int err = 0; 19 | srand(SEED); 20 | int device_type = acc_get_device_type(); 21 | 22 | #pragma acc set if(acc_get_device_type != device_type) 23 | 24 | return err; 25 | } 26 | #endif 27 | 28 | int main(){ 29 | int failcode = 0; 30 | int failed; 31 | #ifndef T1 32 | failed = 0; 33 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 34 | failed = failed + test1(); 35 | } 36 | if (failed != 0){ 37 | failcode = failcode + (1 << 0); 38 | } 39 | #endif 40 | #ifndef T2 41 | failed = 0; 42 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 43 | failed = failed + test2(); 44 | } 45 | if (failed != 0){ 46 | failcode = failcode + (1 << 1); 47 | } 48 | #endif 49 | return failcode; 50 | } 51 | -------------------------------------------------------------------------------- /Tests/shutdown.F90: -------------------------------------------------------------------------------- 1 | #ifndef T1 2 | !T1:construct-independent,shutdown,nonvalidating,V:2.5-2.7 3 | LOGICAL FUNCTION test1() 4 | USE OPENACC 5 | IMPLICIT NONE 6 | INCLUDE "acc_testsuite.Fh" 7 | INTEGER :: errors = 0 8 | 9 | !$acc shutdown 10 | 11 | IF (errors .eq. 0) THEN 12 | test1 = .FALSE. 13 | ELSE 14 | test1 = .TRUE. 15 | END IF 16 | END 17 | #endif 18 | 19 | PROGRAM main 20 | IMPLICIT NONE 21 | INTEGER :: failcode, testrun 22 | LOGICAL :: failed 23 | INCLUDE "acc_testsuite.Fh" 24 | #ifndef T1 25 | LOGICAL :: test1 26 | #endif 27 | failed = .FALSE. 28 | failcode = 0 29 | #ifndef T1 30 | DO testrun = 1, NUM_TEST_CALLS 31 | failed = failed .or. test1() 32 | END DO 33 | IF (failed) THEN 34 | failcode = failcode + 2 ** 0 35 | failed = .FALSE. 36 | END IF 37 | #endif 38 | CALL EXIT (failcode) 39 | END PROGRAM 40 | -------------------------------------------------------------------------------- /Tests/shutdown.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:shutdown,V:2.5-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | 8 | #pragma acc shutdown 9 | 10 | return err; 11 | } 12 | #endif 13 | 14 | int main(){ 15 | int failcode = 0; 16 | int failed; 17 | #ifndef T1 18 | failed = 0; 19 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 20 | failed = failed + test1(); 21 | } 22 | if (failed != 0){ 23 | failcode = failcode + (1 << 0); 24 | } 25 | #endif 26 | return failcode; 27 | } 28 | -------------------------------------------------------------------------------- /Tests/shutdown.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:shutdown,V:2.5-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | 8 | #pragma acc shutdown 9 | 10 | return err; 11 | } 12 | #endif 13 | 14 | int main(){ 15 | int failcode = 0; 16 | int failed; 17 | #ifndef T1 18 | failed = 0; 19 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 20 | failed = failed + test1(); 21 | } 22 | if (failed != 0){ 23 | failcode = failcode + (1 << 0); 24 | } 25 | #endif 26 | return failcode; 27 | } 28 | -------------------------------------------------------------------------------- /Tests/shutdown_device_num.F90: -------------------------------------------------------------------------------- 1 | #ifndef T1 2 | !T1:runtime,construct-independent,internal-control-values,shutdown,nonvalidating,V:2.5-2.7 3 | LOGICAL FUNCTION test1() 4 | USE OPENACC 5 | IMPLICIT NONE 6 | INCLUDE "acc_testsuite.Fh" 7 | INTEGER :: device_num 8 | INTEGER :: device_type 9 | INTEGER :: errors = 0 10 | 11 | device_num = acc_get_device_num(acc_get_device_type()) 12 | !$acc shutdown device_num(device_num) 13 | 14 | IF (errors .eq. 0) THEN 15 | test1 = .FALSE. 16 | ELSE 17 | test1 = .TRUE. 18 | END IF 19 | END 20 | #endif 21 | 22 | PROGRAM main 23 | IMPLICIT NONE 24 | INTEGER :: failcode, testrun 25 | LOGICAL :: failed 26 | INCLUDE "acc_testsuite.Fh" 27 | #ifndef T1 28 | LOGICAL :: test1 29 | #endif 30 | failed = .FALSE. 31 | failcode = 0 32 | #ifndef T1 33 | DO testrun = 1, NUM_TEST_CALLS 34 | failed = failed .or. test1() 35 | END DO 36 | IF (failed) THEN 37 | failcode = failcode + 2 ** 0 38 | failed = .FALSE. 39 | END IF 40 | #endif 41 | CALL EXIT (failcode) 42 | END PROGRAM 43 | -------------------------------------------------------------------------------- /Tests/shutdown_device_num.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:shutdown,runtime,syntactic,V:2.5-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | int device_num; 8 | 9 | device_num = acc_get_device_num(acc_get_device_type()); 10 | #pragma acc shutdown device_num(device_num) 11 | 12 | return err; 13 | } 14 | #endif 15 | 16 | int main(){ 17 | int failcode = 0; 18 | int failed; 19 | #ifndef T1 20 | failed = 0; 21 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 22 | failed = failed + test1(); 23 | } 24 | if (failed != 0){ 25 | failcode = failcode + (1 << 0); 26 | } 27 | #endif 28 | return failcode; 29 | } 30 | -------------------------------------------------------------------------------- /Tests/shutdown_device_num.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:shutdown,runtime,syntactic,V:2.5-2.7 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | int device_num; 8 | 9 | device_num = acc_get_device_num(acc_get_device_type()); 10 | #pragma acc shutdown device_num(device_num) 11 | 12 | return err; 13 | } 14 | #endif 15 | 16 | int main(){ 17 | int failcode = 0; 18 | int failed; 19 | #ifndef T1 20 | failed = 0; 21 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 22 | failed = failed + test1(); 23 | } 24 | if (failed != 0){ 25 | failcode = failcode + (1 << 0); 26 | } 27 | #endif 28 | return failcode; 29 | } 30 | -------------------------------------------------------------------------------- /Tests/shutdown_device_type_num_nvidia.F90: -------------------------------------------------------------------------------- 1 | #ifndef T1 2 | !T1:runtime,construct-independent,internal-control-values,shutdown,nonvalidating,V:2.5-2.7 3 | LOGICAL FUNCTION test1() 4 | USE OPENACC 5 | IMPLICIT NONE 6 | INCLUDE "acc_testsuite.Fh" 7 | INTEGER :: device_num 8 | INTEGER :: device_type 9 | INTEGER :: errors = 0 10 | 11 | device_type = acc_get_device_type() 12 | device_num = acc_get_device_num(device_type) 13 | !$acc shutdown device_type(nvidia) device_num(device_num) 14 | 15 | IF (errors .eq. 0) THEN 16 | test1 = .FALSE. 17 | ELSE 18 | test1 = .TRUE. 19 | END IF 20 | END 21 | #endif 22 | 23 | PROGRAM shutdown_device_type_num 24 | IMPLICIT NONE 25 | INTEGER :: failcode, testrun 26 | LOGICAL :: failed 27 | INCLUDE "acc_testsuite.Fh" 28 | #ifndef T1 29 | LOGICAL :: test1 30 | #endif 31 | failed = .FALSE. 32 | failcode = 0 33 | #ifndef T1 34 | DO testrun = 1, NUM_TEST_CALLS 35 | failed = failed .or. test1() 36 | END DO 37 | IF (failed) THEN 38 | failcode = failcode + 2 ** 0 39 | failed = .FALSE. 40 | END IF 41 | #endif 42 | CALL EXIT (failcode) 43 | END PROGRAM 44 | -------------------------------------------------------------------------------- /Tests/shutdown_device_type_num_nvidia.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:shutdown,runtime,syntactic,V:2.5-2.7 4 | int test1(){ 5 | int err = 0; 6 | int device_num; 7 | 8 | device_num = acc_get_device_num(acc_get_device_type()); 9 | #pragma acc shutdown device_type(nvidia) device_num(device_num) 10 | 11 | return err; 12 | } 13 | #endif 14 | 15 | int main(){ 16 | int failcode = 0; 17 | int failed; 18 | #ifndef T1 19 | failed = 0; 20 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 21 | failed = failed + test1(); 22 | } 23 | if (failed != 0){ 24 | failcode = failcode + (1 << 0); 25 | } 26 | #endif 27 | return failcode; 28 | } 29 | -------------------------------------------------------------------------------- /Tests/shutdown_device_type_num_nvidia.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:shutdown,runtime,syntactic,V:2.5-2.7 4 | int test1(){ 5 | int err = 0; 6 | int device_num; 7 | 8 | device_num = acc_get_device_num(acc_get_device_type()); 9 | #pragma acc shutdown device_type(nvidia) device_num(device_num) 10 | 11 | return err; 12 | } 13 | #endif 14 | 15 | int main(){ 16 | int failcode = 0; 17 | int failed; 18 | #ifndef T1 19 | failed = 0; 20 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 21 | failed = failed + test1(); 22 | } 23 | if (failed != 0){ 24 | failcode = failcode + (1 << 0); 25 | } 26 | #endif 27 | return failcode; 28 | } 29 | -------------------------------------------------------------------------------- /Tests/shutdown_device_type_nvidia.F90: -------------------------------------------------------------------------------- 1 | #ifndef T1 2 | !T1:runtime,construct-independent,internal-control-values,shutdown,nonvalidating,V:2.5-2.7 3 | LOGICAL FUNCTION test1() 4 | USE OPENACC 5 | IMPLICIT NONE 6 | INCLUDE "acc_testsuite.Fh" 7 | INTEGER :: errors = 0 8 | 9 | !$acc shutdown device_type(nvidia) 10 | 11 | IF (errors .eq. 0) THEN 12 | test1 = .FALSE. 13 | ELSE 14 | test1 = .TRUE. 15 | END IF 16 | END 17 | #endif 18 | 19 | PROGRAM shutdown_device_type 20 | IMPLICIT NONE 21 | INTEGER :: failcode, testrun 22 | LOGICAL :: failed 23 | INCLUDE "acc_testsuite.Fh" 24 | #ifndef T1 25 | LOGICAL :: test1 26 | #endif 27 | failed = .FALSE. 28 | failcode = 0 29 | #ifndef T1 30 | DO testrun = 1, NUM_TEST_CALLS 31 | failed = failed .or. test1() 32 | END DO 33 | IF (failed) THEN 34 | failcode = failcode + 2 ** 0 35 | failed = .FALSE. 36 | END IF 37 | #endif 38 | CALL EXIT (failcode) 39 | END PROGRAM 40 | -------------------------------------------------------------------------------- /Tests/shutdown_device_type_nvidia.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:shutdown,runtime,syntactic,V:2.5-3.2 4 | int test1(){ 5 | int err = 0; 6 | 7 | #pragma acc shutdown device_type(nvidia) 8 | 9 | return err; 10 | } 11 | #endif 12 | 13 | int main(){ 14 | int failcode = 0; 15 | int failed; 16 | #ifndef T1 17 | failed = 0; 18 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 19 | failed = failed + test1(); 20 | } 21 | if (failed != 0){ 22 | failcode = failcode + (1 << 0); 23 | } 24 | #endif 25 | return failcode; 26 | } 27 | -------------------------------------------------------------------------------- /Tests/shutdown_device_type_nvidia.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:shutdown,runtime,syntactic,V:2.5-3.2 4 | int test1(){ 5 | int err = 0; 6 | 7 | #pragma acc shutdown device_type(nvidia) 8 | 9 | return err; 10 | } 11 | #endif 12 | 13 | int main(){ 14 | int failcode = 0; 15 | int failed; 16 | #ifndef T1 17 | failed = 0; 18 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 19 | failed = failed + test1(); 20 | } 21 | if (failed != 0){ 22 | failcode = failcode + (1 << 0); 23 | } 24 | #endif 25 | return failcode; 26 | } 27 | -------------------------------------------------------------------------------- /Tests/shutdown_if.c: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:shutdown,if,V:2.7-3.3 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | int device_num; 8 | 9 | device_num = acc_get_device_num(acc_get_device_type()); 10 | #pragma acc shutdown if(device_num == device_num) 11 | 12 | return err; 13 | } 14 | #endif 15 | 16 | #ifndef T2 17 | //T2:shutdown,if,V:2.7-3.3 18 | int test2(){ 19 | int err = 0; 20 | srand(SEED); 21 | int device_num; 22 | 23 | device_num = acc_get_device_num(acc_get_device_type()); 24 | #pragma acc shutdown if(device_num != device_num) 25 | 26 | return err; 27 | } 28 | #endif 29 | 30 | int main(){ 31 | int failcode = 0; 32 | int failed; 33 | #ifndef T1 34 | failed = 0; 35 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 36 | failed = failed + test1(); 37 | } 38 | if (failed != 0){ 39 | failcode = failcode + (1 << 0); 40 | } 41 | #endif 42 | #ifndef T2 43 | failed = 0; 44 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 45 | failed = failed + test2(); 46 | } 47 | if (failed != 0){ 48 | failcode = failcode + (1 << 1); 49 | } 50 | #endif 51 | return failcode; 52 | } 53 | -------------------------------------------------------------------------------- /Tests/shutdown_if.cpp: -------------------------------------------------------------------------------- 1 | #include "acc_testsuite.h" 2 | #ifndef T1 3 | //T1:shutdown,if,V:2.7-3.3 4 | int test1(){ 5 | int err = 0; 6 | srand(SEED); 7 | int device_num; 8 | 9 | device_num = acc_get_device_num(acc_get_device_type()); 10 | #pragma acc shutdown if(device_num == device_num) 11 | 12 | return err; 13 | } 14 | #endif 15 | 16 | #ifndef T2 17 | //T2:shutdown,if,V:2.7-3.3 18 | int test2(){ 19 | int err = 0; 20 | srand(SEED); 21 | int device_num; 22 | 23 | device_num = acc_get_device_num(acc_get_device_type()); 24 | #pragma acc shutdown if(device_num != device_num) 25 | 26 | return err; 27 | } 28 | #endif 29 | 30 | int main(){ 31 | int failcode = 0; 32 | int failed; 33 | #ifndef T1 34 | failed = 0; 35 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 36 | failed = failed + test1(); 37 | } 38 | if (failed != 0){ 39 | failcode = failcode + (1 << 0); 40 | } 41 | #endif 42 | #ifndef T2 43 | failed = 0; 44 | for (int x = 0; x < NUM_TEST_CALLS; ++x){ 45 | failed = failed + test2(); 46 | } 47 | if (failed != 0){ 48 | failcode = failcode + (1 << 1); 49 | } 50 | #endif 51 | return failcode; 52 | } 53 | -------------------------------------------------------------------------------- /UseCases/.gitignore: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /images/OpenACCVVdarknew.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenACCUserGroup/OpenACCV-V/526dbbff7a685dfdc30fcc3f2b761021a7e3e603/images/OpenACCVVdarknew.png -------------------------------------------------------------------------------- /images/OpenACCVVwhitenew.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenACCUserGroup/OpenACCV-V/526dbbff7a685dfdc30fcc3f2b761021a7e3e603/images/OpenACCVVwhitenew.png -------------------------------------------------------------------------------- /results_template/img/OpenACC.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenACCUserGroup/OpenACCV-V/526dbbff7a685dfdc30fcc3f2b761021a7e3e603/results_template/img/OpenACC.jpg -------------------------------------------------------------------------------- /versiontest.F90: -------------------------------------------------------------------------------- 1 | PROGRAM acc_shutdown 2 | IMPLICIT NONE 3 | IF (_OPENACC == 201111) THEN 4 | PRINT*, "1.0" 5 | ELSE IF (_OPENACC == 201306) THEN 6 | PRINT*, "2.0" 7 | ELSE IF (_OPENACC == 201510) THEN 8 | PRINT*, "2.5" 9 | ELSE IF (_OPENACC == 201711) THEN 10 | PRINT*, "2.6" 11 | ELSE IF (_OPENACC == 201811) THEN 12 | PRINT*, "2.7" 13 | ELSE IF (_OPENACC == 201911) THEN 14 | PRINT*, "3.0" 15 | ELSE IF (_OPENACC == 202011) THEN 16 | PRINT*, "3.1" 17 | ELSE IF (_OPENACC == 202111) THEN 18 | PRINT*, "3.2" 19 | ELSE IF (_OPENACC == 202211) THEN 20 | PRINT*, "3.3" 21 | ELSE 22 | CALL EXIT(1) 23 | END IF 24 | CALL EXIT (0) 25 | END PROGRAM 26 | 27 | -------------------------------------------------------------------------------- /versiontest.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(){ 5 | if (_OPENACC == 201111){ 6 | printf("1.0"); 7 | } 8 | else if (_OPENACC == 201306){ 9 | printf("2.0"); 10 | } 11 | else if (_OPENACC == 201510){ 12 | printf("2.5"); 13 | } 14 | else if (_OPENACC == 201711){ 15 | printf("2.6"); 16 | } 17 | else if (_OPENACC == 201811){ 18 | printf("2.7"); 19 | } 20 | else if (_OPENACC == 201911){ 21 | printf("3.0"); 22 | } 23 | else if (_OPENACC == 202011){ 24 | printf("3.1"); 25 | } 26 | else if (_OPENACC == 202111){ 27 | printf("3.2"); 28 | } 29 | else if (_OPENACC == 202211){ 30 | printf("3.3"); 31 | } 32 | else{ 33 | return 1; 34 | } 35 | return 0; 36 | } 37 | -------------------------------------------------------------------------------- /versiontest.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(){ 5 | if (_OPENACC == 201111){ 6 | printf("1.0"); 7 | } 8 | else if (_OPENACC == 201306){ 9 | printf("2.0"); 10 | } 11 | else if (_OPENACC == 201510){ 12 | printf("2.5"); 13 | } 14 | else if (_OPENACC == 201711){ 15 | printf("2.6"); 16 | } 17 | else if (_OPENACC == 201811){ 18 | printf("2.7"); 19 | } 20 | else if (_OPENACC == 201911){ 21 | printf("3.0"); 22 | } 23 | else if (_OPENACC == 202011){ 24 | printf("3.1"); 25 | } 26 | else if (_OPENACC == 202111){ 27 | printf("3.2"); 28 | } 29 | else if (_OPENACC == 202211){ 30 | printf("3.3"); 31 | } 32 | else{ 33 | return 1; 34 | } 35 | return 0; 36 | } 37 | --------------------------------------------------------------------------------