|
2846 | 2846 | "language": "cpp", |
2847 | 2847 | "name": "15_graph_edge_count", |
2848 | 2848 | "parallelism_model": "omp", |
2849 | | - "prompt": "#include <omp.h>\n\n/* Count the number of edges in the directed graph defined by the adjacency matrix A.\n A is an NxN adjacency matrix stored in row-major. A represents a directed graph.\n Use OpenMP to compute in parallel.\n Example:\n\n\t input: [[0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1], [1, 1, 1, 0]]\n output: 3\n*/\nint edgeCount(std::vector<int> const& A, size_t N) {" |
| 2849 | + "prompt": "#include <omp.h>\n\n/* Count the number of edges in the directed graph defined by the adjacency matrix A.\n A is an NxN adjacency matrix stored in row-major. A represents a directed graph.\n Use OpenMP to compute in parallel.\n Example:\n\n\t input: [[0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1], [1, 1, 1, 0]]\n output: 6\n*/\nint edgeCount(std::vector<int> const& A, size_t N) {" |
2850 | 2850 | }, |
2851 | 2851 | { |
2852 | 2852 | "problem_type": "graph", |
2853 | 2853 | "language": "cpp", |
2854 | 2854 | "name": "15_graph_edge_count", |
2855 | 2855 | "parallelism_model": "hip", |
2856 | | - "prompt": "/* Count the number of edges in the directed graph defined by the adjacency matrix A.\n Store the result in numEdges. A represents a directed graph.\n A is an NxN adjacency matrix stored in row-major.\n Use AMD HIP to compute in parallel. The kernel is launched with at least N threads.\n Example:\n\n\t input: [[0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1], [1, 1, 1, 0]]\n output: 3\n*/\n__global__ void edgeCount(const int *A, size_t N, int *numEdges) {" |
| 2856 | + "prompt": "/* Count the number of edges in the directed graph defined by the adjacency matrix A.\n Store the result in numEdges. A represents a directed graph.\n A is an NxN adjacency matrix stored in row-major.\n Use AMD HIP to compute in parallel. The kernel is launched with at least N threads.\n Example:\n\n\t input: [[0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1], [1, 1, 1, 0]]\n output: 6\n*/\n__global__ void edgeCount(const int *A, size_t N, int *numEdges) {" |
2857 | 2857 | }, |
2858 | 2858 | { |
2859 | 2859 | "problem_type": "graph", |
2860 | 2860 | "language": "cpp", |
2861 | 2861 | "name": "15_graph_edge_count", |
2862 | 2862 | "parallelism_model": "mpi+omp", |
2863 | | - "prompt": "#include <mpi.h>\n#include <omp.h>\n\n/* Count the number of edges in the directed graph defined by the adjacency matrix A.\n A is an NxN adjacency matrix stored in row-major. A represents a directed graph.\n Use MPI and OpenMP to compute in parallel. Assume MPI has already been initialized.\n Every rank has a complete copy of A. The result is returned on rank 0.\n Example:\n\n\t input: [[0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1], [1, 1, 1, 0]]\n output: 3\n*/\nint edgeCount(std::vector<int> const& A, size_t N) {" |
| 2863 | + "prompt": "#include <mpi.h>\n#include <omp.h>\n\n/* Count the number of edges in the directed graph defined by the adjacency matrix A.\n A is an NxN adjacency matrix stored in row-major. A represents a directed graph.\n Use MPI and OpenMP to compute in parallel. Assume MPI has already been initialized.\n Every rank has a complete copy of A. The result is returned on rank 0.\n Example:\n\n\t input: [[0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1], [1, 1, 1, 0]]\n output: 6\n*/\nint edgeCount(std::vector<int> const& A, size_t N) {" |
2864 | 2864 | }, |
2865 | 2865 | { |
2866 | 2866 | "problem_type": "graph", |
2867 | 2867 | "language": "cpp", |
2868 | 2868 | "name": "15_graph_edge_count", |
2869 | 2869 | "parallelism_model": "kokkos", |
2870 | | - "prompt": "#include <Kokkos_Core.hpp>\n\n/* Count the number of edges in the directed graph defined by the adjacency matrix A.\n A is an NxN adjacency matrix. A represents a directed graph.\n Use Kokkos to compute in parallel. Assume Kokkos has already been initialized.\n Example:\n\n\t input: [[0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1], [1, 1, 1, 0]]\n output: 3\n*/\nint edgeCount(Kokkos::View<const int**> &A, size_t N) {" |
| 2870 | + "prompt": "#include <Kokkos_Core.hpp>\n\n/* Count the number of edges in the directed graph defined by the adjacency matrix A.\n A is an NxN adjacency matrix. A represents a directed graph.\n Use Kokkos to compute in parallel. Assume Kokkos has already been initialized.\n Example:\n\n\t input: [[0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1], [1, 1, 1, 0]]\n output: 6\n*/\nint edgeCount(Kokkos::View<const int**> &A, size_t N) {" |
2871 | 2871 | }, |
2872 | 2872 | { |
2873 | 2873 | "problem_type": "graph", |
2874 | 2874 | "language": "cpp", |
2875 | 2875 | "name": "15_graph_edge_count", |
2876 | 2876 | "parallelism_model": "cuda", |
2877 | | - "prompt": "/* Count the number of edges in the directed graph defined by the adjacency matrix A.\n Store the result in numEdges. A represents a directed graph.\n A is an NxN adjacency matrix stored in row-major.\n Use CUDA to compute in parallel. The kernel is launched with at least N threads.\n Example:\n\n\t input: [[0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1], [1, 1, 1, 0]]\n output: 3\n*/\n__global__ void edgeCount(const int *A, size_t N, int *numEdges) {" |
| 2877 | + "prompt": "/* Count the number of edges in the directed graph defined by the adjacency matrix A.\n Store the result in numEdges. A represents a directed graph.\n A is an NxN adjacency matrix stored in row-major.\n Use CUDA to compute in parallel. The kernel is launched with at least N threads.\n Example:\n\n\t input: [[0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1], [1, 1, 1, 0]]\n output: 6\n*/\n__global__ void edgeCount(const int *A, size_t N, int *numEdges) {" |
2878 | 2878 | }, |
2879 | 2879 | { |
2880 | 2880 | "problem_type": "graph", |
2881 | 2881 | "language": "cpp", |
2882 | 2882 | "name": "15_graph_edge_count", |
2883 | 2883 | "parallelism_model": "mpi", |
2884 | | - "prompt": "#include <mpi.h>\n\n/* Count the number of edges in the directed graph defined by the adjacency matrix A.\n A is an NxN adjacency matrix stored in row-major. A represents a directed graph.\n Use MPI to compute in parallel. Assume MPI has already been initialized.\n Every rank has a complete copy of A. The result is returned on rank 0.\n Example:\n\n\t input: [[0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1], [1, 1, 1, 0]]\n output: 3\n*/\nint edgeCount(std::vector<int> const& A, size_t N) {" |
| 2884 | + "prompt": "#include <mpi.h>\n\n/* Count the number of edges in the directed graph defined by the adjacency matrix A.\n A is an NxN adjacency matrix stored in row-major. A represents a directed graph.\n Use MPI to compute in parallel. Assume MPI has already been initialized.\n Every rank has a complete copy of A. The result is returned on rank 0.\n Example:\n\n\t input: [[0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1], [1, 1, 1, 0]]\n output: 6\n*/\nint edgeCount(std::vector<int> const& A, size_t N) {" |
2885 | 2885 | }, |
2886 | 2886 | { |
2887 | 2887 | "problem_type": "graph", |
2888 | 2888 | "language": "cpp", |
2889 | 2889 | "name": "15_graph_edge_count", |
2890 | 2890 | "parallelism_model": "serial", |
2891 | | - "prompt": "/* Count the number of edges in the directed graph defined by the adjacency matrix A.\n A is an NxN adjacency matrix stored in row-major. A represents a directed graph.\n Example:\n\n\t input: [[0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1], [1, 1, 1, 0]]\n output: 3\n*/\nint edgeCount(std::vector<int> const& A, size_t N) {" |
| 2891 | + "prompt": "/* Count the number of edges in the directed graph defined by the adjacency matrix A.\n A is an NxN adjacency matrix stored in row-major. A represents a directed graph.\n Example:\n\n\t input: [[0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1], [1, 1, 1, 0]]\n output: 6\n*/\nint edgeCount(std::vector<int> const& A, size_t N) {" |
2892 | 2892 | }, |
2893 | 2893 | { |
2894 | 2894 | "problem_type": "graph", |
|
0 commit comments