Skip to content

Commit 9a9220b

Browse files
authored
change example output from 3 to 6 in edgeCount (#43)
1 parent 883ed97 commit 9a9220b

9 files changed

Lines changed: 15 additions & 15 deletions

File tree

drivers/cpp/benchmarks/graph/15_graph_edge_count/baseline.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
Example:
1111
1212
input: [[0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1], [1, 1, 1, 0]]
13-
output: 3
13+
output: 6
1414
*/
1515
int NO_INLINE correctEdgeCount(std::vector<int> const& A, size_t N) {
1616
int count = 0;

prompts/generation-prompts.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2846,49 +2846,49 @@
28462846
"language": "cpp",
28472847
"name": "15_graph_edge_count",
28482848
"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) {"
28502850
},
28512851
{
28522852
"problem_type": "graph",
28532853
"language": "cpp",
28542854
"name": "15_graph_edge_count",
28552855
"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) {"
28572857
},
28582858
{
28592859
"problem_type": "graph",
28602860
"language": "cpp",
28612861
"name": "15_graph_edge_count",
28622862
"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) {"
28642864
},
28652865
{
28662866
"problem_type": "graph",
28672867
"language": "cpp",
28682868
"name": "15_graph_edge_count",
28692869
"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) {"
28712871
},
28722872
{
28732873
"problem_type": "graph",
28742874
"language": "cpp",
28752875
"name": "15_graph_edge_count",
28762876
"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) {"
28782878
},
28792879
{
28802880
"problem_type": "graph",
28812881
"language": "cpp",
28822882
"name": "15_graph_edge_count",
28832883
"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) {"
28852885
},
28862886
{
28872887
"problem_type": "graph",
28882888
"language": "cpp",
28892889
"name": "15_graph_edge_count",
28902890
"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) {"
28922892
},
28932893
{
28942894
"problem_type": "graph",

prompts/raw/graph/15_graph_edge_count/cuda

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
Example:
66

77
input: [[0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1], [1, 1, 1, 0]]
8-
output: 3
8+
output: 6
99
*/
1010
__global__ void edgeCount(const int *A, size_t N, int *numEdges) {

prompts/raw/graph/15_graph_edge_count/hip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
Example:
66

77
input: [[0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1], [1, 1, 1, 0]]
8-
output: 3
8+
output: 6
99
*/
1010
__global__ void edgeCount(const int *A, size_t N, int *numEdges) {

prompts/raw/graph/15_graph_edge_count/kokkos

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
Example:
55

66
input: [[0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1], [1, 1, 1, 0]]
7-
output: 3
7+
output: 6
88
*/
99
int edgeCount(Kokkos::View<const int**> &A, size_t N) {

prompts/raw/graph/15_graph_edge_count/mpi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
Example:
66

77
input: [[0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1], [1, 1, 1, 0]]
8-
output: 3
8+
output: 6
99
*/
1010
int edgeCount(std::vector<int> const& A, size_t N) {

prompts/raw/graph/15_graph_edge_count/mpi+omp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
Example:
66

77
input: [[0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1], [1, 1, 1, 0]]
8-
output: 3
8+
output: 6
99
*/
1010
int edgeCount(std::vector<int> const& A, size_t N) {

prompts/raw/graph/15_graph_edge_count/omp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
Example:
55

66
input: [[0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1], [1, 1, 1, 0]]
7-
output: 3
7+
output: 6
88
*/
99
int edgeCount(std::vector<int> const& A, size_t N) {

prompts/raw/graph/15_graph_edge_count/serial

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
Example:
44

55
input: [[0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1], [1, 1, 1, 0]]
6-
output: 3
6+
output: 6
77
*/
88
int edgeCount(std::vector<int> const& A, size_t N) {

0 commit comments

Comments
 (0)