Files
TheRock/rocm-systems/projects/rocprofiler-systems/examples/hpc/jacobi-hip/defines.hpp
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

100 lines
3.6 KiB
C++

/***************************************************************************
Copyright (c) 2022-2023, Advanced Micro Devices, Inc. All rights reserved.
***************************************************************************/
/**
* Setting this to 1 makes the application use only single-precision floating-point data.
* Set this to 0 in order to use double-precision floating-point data instead.
*/
#define USE_FLOAT 0
/**
* This is the default domain size (when not explicitly stated with "-d" in the
* command-line arguments).
*/
#define DEFAULT_DOMAIN_SIZE 4096
/**
* This is the minimum acceptable domain size in any of the 2 dimensions.
*/
#define MIN_DOM_SIZE 1
/**
* Global domain dimensions
*/
#define X_MIN -0.5
#define X_MAX 0.5
#define Y_MIN -0.5
#define Y_MAX 0.5
/**
* Side Indices
*/
#define NSIDES 4
#define SIDE_DOWN 0
#define SIDE_RIGHT 1
#define SIDE_UP 2
#define SIDE_LEFT 3
/**
* This is the Jacobi tolerance threshold. The run is considered to have converged when
* the maximum residue falls below this value.
*/
#define JACOBI_TOLERANCE 1.0E-5F
/**
* This is the Jacobi iteration count limit. The Jacobi run will never cycle more than
* this, even if it has not converged when finishing the last allowed iteration.
*/
#define JACOBI_MAX_LOOPS 1000
/**
* This is the status value that indicates a successful operation.
*/
#define STATUS_OK 0
/**
* This is the status value that indicates an error.
*/
#define STATUS_ERR -1
#if USE_FLOAT
# define dfloat float
# define MPI_DFLOAT MPI_FLOAT
#else
# define dfloat double
# define MPI_DFLOAT MPI_DOUBLE
#endif
#define uint64 unsigned long long
#define MPI_UINT64 MPI_UNSIGNED_LONG_LONG
#define SafeHipCall(call) CheckHipCall(call, #call, __FILE__, __LINE__)
#define SafeHostFree(block) \
{ \
if(block) free(block); \
}
#define SafeDevFree(block) \
{ \
if(block) SafeHipCall(hipFree(block)); \
}
#define OnePrintf(allow, ...) \
{ \
if(allow) printf(__VA_ARGS__); \
}
#define OneErrPrintf(allow, ...) \
{ \
if(allow) fprintf(stderr, __VA_ARGS__); \
}
#define HasNeighbor(neighbors, dir) (neighbors[dir] != MPI_PROC_NULL)
#define CheckHipCall(command, commandName, fileName, line) \
if(command != hipSuccess) \
{ \
fprintf(stderr, \
"Error: \"%s\" for call \"%s\"" \
"in file \"%s\" at line %d. Terminating...\n", \
hipGetErrorString(command), commandName, fileName, line); \
MPI_Abort(MPI_COMM_WORLD, STATUS_ERR); \
}