id
stringlengths
25
27
content
stringlengths
171
1.05k
pareval_generation_data_1
#include <Kokkos_Core.hpp> struct Point { double x, y; }; double triangleArea(Point const& A, Point const& B, Point const& C) { return 0.5 * std::abs( A.x*(B.y-C.y) + B.x*(C.y-A.y) + C.x*(A.y-B.y) ); } /* Return the area of the smallest triangle that can be formed by any 3 points. Use Kokkos to compute in para...
pareval_generation_data_2
#include <omp.h> struct Point { double x, y; }; double triangleArea(Point const& A, Point const& B, Point const& C) { return 0.5 * std::abs( A.x*(B.y-C.y) + B.x*(C.y-A.y) + C.x*(A.y-B.y) ); } /* Return the area of the smallest triangle that can be formed by any 3 points. Use OpenMP to compute in parallel. E...
pareval_generation_data_3
struct Point { double x, y; }; double triangleArea(Point const& A, Point const& B, Point const& C) { return 0.5 * std::abs( A.x*(B.y-C.y) + B.x*(C.y-A.y) + C.x*(A.y-B.y) ); } /* Return the area of the smallest triangle that can be formed by any 3 points. Example: input: [{0, 10}, {5, 5}, {1,0}, {-1, 1}, {-1...
pareval_generation_data_4
struct Point { double x, y; }; __device__ double triangleArea(Point const& A, Point const& B, Point const& C) { return 0.5 * fabs( A.x*(B.y-C.y) + B.x*(C.y-A.y) + C.x*(A.y-B.y) ); } /* Compute the area of the smallest triangle that can be formed by any 3 points. Return the result in area. Use AMD HIP to comp...
pareval_generation_data_5
#include <mpi.h> struct Point { double x, y; }; double triangleArea(Point const& A, Point const& B, Point const& C) { return 0.5 * std::abs( A.x*(B.y-C.y) + B.x*(C.y-A.y) + C.x*(A.y-B.y) ); } /* Return the area of the smallest triangle that can be formed by any 3 points. Use MPI to compute in parallel. Assume ...
pareval_generation_data_6
struct Point { double x, y; }; __device__ double triangleArea(Point const& A, Point const& B, Point const& C) { return 0.5 * fabs( A.x*(B.y-C.y) + B.x*(C.y-A.y) + C.x*(A.y-B.y) ); } /* Compute the area of the smallest triangle that can be formed by any 3 points. Return the result in area. Use CUDA to compute...
pareval_generation_data_7
#include <mpi.h> #include <omp.h> struct Point { double x, y; }; double triangleArea(Point const& A, Point const& B, Point const& C) { return 0.5 * std::abs( A.x*(B.y-C.y) + B.x*(C.y-A.y) + C.x*(A.y-B.y) ); } /* Return the area of the smallest triangle that can be formed by any 3 points. Use MPI and OpenMP to ...
pareval_generation_data_8
#include <Kokkos_Core.hpp> double distance(double x1, double x2) { return std::abs(x1 - x2); } /* Return the distance between the closest two elements in the vector x. Use Kokkos to compute in parallel. Assume Kokkos is already initialized. Example: input: [7, 3, 9, 12, 31, 1] output: 2 */ double close...
pareval_generation_data_9
#include <omp.h> double distance(double x1, double x2) { return std::abs(x1 - x2); } /* Return the distance between the closest two elements in the vector x. Use OpenMP to compute in parallel. Example: input: [7, 3, 9, 12, 31, 1] output: 2 */ double closestPair(std::vector<double> const& x) {
pareval_generation_data_10
double distance(double x1, double x2) { return std::abs(x1 - x2); } /* Return the distance between the closest two elements in the vector x. Example: input: [7, 3, 9, 12, 31, 1] output: 2 */ double closestPair(std::vector<double> const& x) {
pareval_generation_data_11
__device__ double distanceBetweenPoints(double x1, double x2) { return fabs(x1 - x2); } /* Compute the distance between the closest two elements in the vector x. Store the result in distance. Use AMD HIP to compute in parallel. The kernel is launched with at least N threads. Example: input: [7, 3, 9, 12,...
pareval_generation_data_12
#include <mpi.h> double distance(double x1, double x2) { return std::abs(x1 - x2); } /* Return the distance between the closest two elements in the vector x. Use MPI to compute in parallel. Assume MPI is already initialized. Example: input: [7, 3, 9, 12, 31, 1] output: 2 */ double closestPair(std::vect...
pareval_generation_data_13
__device__ double distanceBetweenPoints(double x1, double x2) { return fabs(x1 - x2); } /* Compute the distance between the closest two elements in the vector x. Store the result in distance. Use CUDA to compute in parallel. The kernel is launched with at least N threads. Example: input: [7, 3, 9, 12, 31...
pareval_generation_data_14
#include <mpi.h> #include <omp.h> double distance(double x1, double x2) { return std::abs(x1 - x2); } /* Return the distance between the closest two elements in the vector x. Use MPI and OpenMP to compute in parallel. Assume MPI is already initialized. Example: input: [7, 3, 9, 12, 31, 1] output: 2 */ ...
pareval_generation_data_15
#include <Kokkos_Core.hpp> struct Point { double x, y; }; double distance(Point const& p1, Point const& p2) { return std::sqrt(std::pow(p2.x-p1.x, 2) + std::pow(p2.y-p1.y, 2)); } /* Return the distance between the closest two points in the vector points. Use Kokkos to compute in parallel. Assume Kokkos has alre...
pareval_generation_data_16
#include <omp.h> struct Point { double x, y; }; double distance(Point const& p1, Point const& p2) { return std::sqrt(std::pow(p2.x-p1.x, 2) + std::pow(p2.y-p1.y, 2)); } /* Return the distance between the closest two points in the vector points. Use OpenMP to compute in parallel. Example: input: [{2, 3},...
pareval_generation_data_17
struct Point { double x, y; }; double distance(Point const& p1, Point const& p2) { return std::sqrt(std::pow(p2.x-p1.x, 2) + std::pow(p2.y-p1.y, 2)); } /* Return the distance between the closest two points in the vector points. Example: input: [{2, 3}, {12, 30}, {40, 50}, {5, 1}, {12, 10}, {3, 4}] output...
pareval_generation_data_18
struct Point { double x, y; }; __device__ double distanceBetweenPoints(Point const& p1, Point const& p2) { return sqrt(pow(p2.x-p1.x, 2) + pow(p2.y-p1.y, 2)); } /* Compute the distance between the closest two points in the vector points. Store the result in distance. Use AMD HIP to compute in parallel. The ke...
pareval_generation_data_19
#include <mpi.h> struct Point { double x, y; }; double distance(Point const& p1, Point const& p2) { return std::sqrt(std::pow(p2.x-p1.x, 2) + std::pow(p2.y-p1.y, 2)); } /* Return the distance between the closest two points in the vector points. Use MPI to compute in parallel. Assume MPI has already been initial...
pareval_generation_data_20
struct Point { double x, y; }; __device__ double distanceBetweenPoints(Point const& p1, Point const& p2) { return sqrt(pow(p2.x-p1.x, 2) + pow(p2.y-p1.y, 2)); } /* Compute the distance between the closest two points in the vector points. Store the result in distance. Use CUDA to compute in parallel. The kerne...
pareval_generation_data_21
#include <mpi.h> #include <omp.h> struct Point { double x, y; }; double distance(Point const& p1, Point const& p2) { return std::sqrt(std::pow(p2.x-p1.x, 2) + std::pow(p2.y-p1.y, 2)); } /* Return the distance between the closest two points in the vector points. Use MPI and OpenMP to compute in parallel. Assume ...
pareval_generation_data_22
#include <Kokkos_Core.hpp> struct Point { double x, y; }; /* Find the set of points that defined the smallest convex polygon that contains all the points in the vector points. Store the result in `hull`. Use Kokkos to compute in parallel. Assume Kokkos is already initialized. Example: input: [{0, 3}, {1,...
pareval_generation_data_23
#include <omp.h> struct Point { double x, y; }; /* Find the set of points that defined the smallest convex polygon that contains all the points in the vector points. Store the result in `hull`. Use OpenMP to compute in parallel. Example: input: [{0, 3}, {1, 1}, {2, 2}, {4, 4}, {0, 0}, {1, 2}, {3, 1}, {3,...
pareval_generation_data_24
struct Point { double x, y; }; /* Find the set of points that defined the smallest convex polygon that contains all the points in the vector points. Store the result in `hull`. Example: input: [{0, 3}, {1, 1}, {2, 2}, {4, 4}, {0, 0}, {1, 2}, {3, 1}, {3, 3}] output: [{0, 3}, {4, 4}, {3, 1}, {0, 0}] */ void...
pareval_generation_data_25
struct Point { double x, y; }; /* Find the set of points that defined the smallest convex polygon that contains all the points in the vector points. Store the result in `hull`. Use AMD HIP to compute in parallel. The kernel is launched with at least as many threads as points. Example: input: [{0, 3}, {1, ...
pareval_generation_data_26
#include <mpi.h> struct Point { double x, y; }; /* Find the set of points that defined the smallest convex polygon that contains all the points in the vector points. Store the result in `hull`. Use MPI to compute in parallel. Assume MPI is already initialized. Every rank has a complete copy of points. The fi...
pareval_generation_data_27
struct Point { double x, y; }; /* Find the set of points that defined the smallest convex polygon that contains all the points in the vector points. Store the result in `hull`. Use CUDA to compute in parallel. The kernel is launched with at least as many threads as points. Example: input: [{0, 3}, {1, 1},...
pareval_generation_data_28
#include <mpi.h> #include <omp.h> struct Point { double x, y; }; /* Find the set of points that defined the smallest convex polygon that contains all the points in the vector points. Store the result in `hull`. Use MPI and OpenMP to compute in parallel. Assume MPI is already initialized. Every rank has a com...
pareval_generation_data_29
#include <Kokkos_Core.hpp> struct Point { double x, y; }; double distance(Point const& p1, Point const& p2) { return std::sqrt(std::pow(p2.x-p1.x, 2) + std::pow(p2.y-p1.y, 2)); } /* Return the perimeter of the smallest convex polygon that contains all the points in the vector points. Use Kokkos to compute in pa...
pareval_generation_data_30
#include <omp.h> struct Point { double x, y; }; double distance(Point const& p1, Point const& p2) { return std::sqrt(std::pow(p2.x-p1.x, 2) + std::pow(p2.y-p1.y, 2)); } /* Return the perimeter of the smallest convex polygon that contains all the points in the vector points. Use OpenMP to compute in parallel. ...
pareval_generation_data_31
struct Point { double x, y; }; double distance(Point const& p1, Point const& p2) { return std::sqrt(std::pow(p2.x-p1.x, 2) + std::pow(p2.y-p1.y, 2)); } /* Return the perimeter of the smallest convex polygon that contains all the points in the vector points. Example: input: [{0, 3}, {1, 1}, {2, 2}, {4, 4}, {0...
pareval_generation_data_32
struct Point { double x, y; }; __device__ double distance(Point const& p1, Point const& p2) { return sqrt(pow(p2.x-p1.x, 2) + pow(p2.y-p1.y, 2)); } /* Compute the perimeter of the smallest convex polygon that contains all the points in the vector points. Store the result in perimeter. Use AMD HIP to compute i...
pareval_generation_data_33
#include <mpi.h> struct Point { double x, y; }; double distance(Point const& p1, Point const& p2) { return std::sqrt(std::pow(p2.x-p1.x, 2) + std::pow(p2.y-p1.y, 2)); } /* Return the perimeter of the smallest convex polygon that contains all the points in the vector points. Use MPI to compute in parallel. Assum...
pareval_generation_data_34
struct Point { double x, y; }; __device__ double distance(Point const& p1, Point const& p2) { return sqrt(pow(p2.x-p1.x, 2) + pow(p2.y-p1.y, 2)); } /* Compute the perimeter of the smallest convex polygon that contains all the points in the vector points. Store the result in perimeter. Use CUDA to compute in p...
pareval_generation_data_35
#include <mpi.h> #include <omp.h> struct Point { double x, y; }; double distance(Point const& p1, Point const& p2) { return std::sqrt(std::pow(p2.x-p1.x, 2) + std::pow(p2.y-p1.y, 2)); } /* Return the perimeter of the smallest convex polygon that contains all the points in the vector points. Use MPI and OpenMP t...
pareval_generation_data_36
#include <Kokkos_Core.hpp> /* Return the number of vertices in the largest component of the undirected graph defined by the adjacency matrix A. A is an NxN adjacency matrix. A is an undirected graph. Use Kokkos to compute in parallel. Assume Kokkos has already been initialized. Example: input: [[0, 1, 0, 0...
pareval_generation_data_37
#include <omp.h> /* Return the number of vertices in the largest component of the undirected graph defined by the adjacency matrix A. A is an NxN adjacency matrix stored in row-major. A is an undirected graph. Use OpenMP to compute in parallel. Example: input: [[0, 1, 0, 0], [1, 0, 0, 0], [0, 0, 0, 1], [0,...
pareval_generation_data_38
/* Return the number of vertices in the largest component of the undirected graph defined by the adjacency matrix A. A is an NxN adjacency matrix stored in row-major. A is an undirected graph. Example: input: [[0, 1, 0, 0], [1, 0, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0]] output: 2 */ int largestComponent(std::vec...
pareval_generation_data_39
/* Compute the number of vertices in the largest component of the undirected graph defined by the adjacency matrix A. Store the result in largestComponentSize. A is an NxN adjacency matrix stored in row-major. A is an undirected graph. Use AMD HIP to compute in parallel. The kernel is launched on an NxN grid o...
pareval_generation_data_40
#include <mpi.h> /* Return the number of vertices in the largest component of the undirected graph defined by the adjacency matrix A. A is an NxN adjacency matrix stored in row-major. A is an undirected graph. Use MPI to compute in parallel. Assume MPI has already been initialized. Every rank has a complete c...
pareval_generation_data_41
/* Compute the number of vertices in the largest component of the undirected graph defined by the adjacency matrix A. Store the result in largestComponentSize. A is an NxN adjacency matrix stored in row-major. A is an undirected graph. Use CUDA to compute in parallel. The kernel is launched on an NxN grid of t...
pareval_generation_data_42
#include <mpi.h> #include <omp.h> /* Return the number of vertices in the largest component of the undirected graph defined by the adjacency matrix A. A is an NxN adjacency matrix stored in row-major. A is an undirected graph. Use MPI and OpenMP to compute in parallel. Assume MPI has already been initialized. ...
pareval_generation_data_43
#include <Kokkos_Core.hpp> /* Count the number of connected components in the undirected graph defined by the adjacency matrix A. A is an NxN adjacency matrix. A is an undirected graph. Use Kokkos to compute in parallel. Assume Kokkos has already been initialized. Example: input: [[0, 1, 0, 0], [1, 0, 0, 0]...
pareval_generation_data_44
#include <omp.h> /* Count the number of connected components in the undirected graph defined by the adjacency matrix A. A is an NxN adjacency matrix stored in row-major. A is an undirected graph. Use OpenMP to compute in parallel. Example: input: [[0, 1, 0, 0], [1, 0, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0]] o...
pareval_generation_data_45
/* Count the number of connected components in the undirected graph defined by the adjacency matrix A. A is an NxN adjacency matrix stored in row-major. A is an undirected graph. Example: input: [[0, 1, 0, 0], [1, 0, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0]] output: 2 */ int componentCount(std::vector<int> const& ...
pareval_generation_data_46
/* Count the number of connected components in the undirected graph defined by the adjacency matrix A. A is an NxN adjacency matrix stored in row-major. A is an undirected graph. Use AMD HIP to compute in parallel. The kernel is launched on an NxN grid of threads. Example: input: [[0, 1, 0, 0], [1, 0, 0, 0],...
pareval_generation_data_47
#include <mpi.h> /* Count the number of connected components in the undirected graph defined by the adjacency matrix A. A is an NxN adjacency matrix stored in row-major. A is an undirected graph. Use MPI to compute in parallel. Assume MPI has already been initialized. Every rank has a complete copy of A. The c...
pareval_generation_data_48
/* Count the number of connected components in the undirected graph defined by the adjacency matrix A. A is an NxN adjacency matrix stored in row-major. A is an undirected graph. Use CUDA to compute in parallel. The kernel is launched on an NxN grid of threads. Example: input: [[0, 1, 0, 0], [1, 0, 0, 0], [0...
pareval_generation_data_49
#include <mpi.h> #include <omp.h> /* Count the number of connected components in the undirected graph defined by the adjacency matrix A. A is an NxN adjacency matrix stored in row-major. A is an undirected graph. Use MPI and OpenMP to compute in parallel. Assume MPI has already been initialized. Every rank has...
pareval_generation_data_50
#include <Kokkos_Core.hpp> /* Count the number of edges in the directed graph defined by the adjacency matrix A. A is an NxN adjacency matrix. A represents a directed graph. Use Kokkos to compute in parallel. Assume Kokkos has already been initialized. Example: input: [[0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0,...
pareval_generation_data_51
#include <omp.h> /* Count the number of edges in the directed graph defined by the adjacency matrix A. A is an NxN adjacency matrix stored in row-major. A represents a directed graph. Use OpenMP to compute in parallel. Example: input: [[0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1], [1, 1, 1, 0]] output: 3 */...
pareval_generation_data_52
/* Count the number of edges in the directed graph defined by the adjacency matrix A. A is an NxN adjacency matrix stored in row-major. A represents a directed graph. Example: input: [[0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1], [1, 1, 1, 0]] output: 3 */ int edgeCount(std::vector<int> const& A, size_t N) {
pareval_generation_data_53
/* Count the number of edges in the directed graph defined by the adjacency matrix A. Store the result in numEdges. A represents a directed graph. A is an NxN adjacency matrix stored in row-major. Use AMD HIP to compute in parallel. The kernel is launched with at least N threads. Example: input: [[0, 0, ...
pareval_generation_data_54
#include <mpi.h> /* Count the number of edges in the directed graph defined by the adjacency matrix A. A is an NxN adjacency matrix stored in row-major. A represents a directed graph. Use MPI to compute in parallel. Assume MPI has already been initialized. Every rank has a complete copy of A. The result is re...
pareval_generation_data_55
/* Count the number of edges in the directed graph defined by the adjacency matrix A. Store the result in numEdges. A represents a directed graph. A is an NxN adjacency matrix stored in row-major. Use CUDA to compute in parallel. The kernel is launched with at least N threads. Example: input: [[0, 0, 0, ...
pareval_generation_data_56
#include <mpi.h> #include <omp.h> /* Count the number of edges in the directed graph defined by the adjacency matrix A. A is an NxN adjacency matrix stored in row-major. A represents a directed graph. Use MPI and OpenMP to compute in parallel. Assume MPI has already been initialized. Every rank has a complete...
pareval_generation_data_57
#include <Kokkos_Core.hpp> /* Compute the highest node degree in the undirected graph. The graph is defined in the adjacency matrix A. A is an NxN adjacency matrix. A is an undirected graph. Use Kokkos to compute in parallel. Assume Kokkos has already been initialized. Example: input: [[0, 0, 0, 1], [0, 0,...
pareval_generation_data_58
#include <omp.h> /* Compute the highest node degree in the undirected graph. The graph is defined in the adjacency matrix A. A is an NxN adjacency matrix stored in row-major. A is an undirected graph. Use OpenMP to compute in parallel. Example: input: [[0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1], [1, 1, 1, 0]...
pareval_generation_data_59
/* Compute the highest node degree in the undirected graph. The graph is defined in the adjacency matrix A. A is an NxN adjacency matrix stored in row-major. A is an undirected graph. Example: input: [[0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1], [1, 1, 1, 0]] output: 3 */ int maxDegree(std::vector<int> const& ...
pareval_generation_data_60
/* Compute the highest node degree in the undirected graph. The graph is defined in the adjacency matrix A. A is an NxN adjacency matrix stored in row-major. A is an undirected graph. Store the result in maxDegree. Use AMD HIP to compute in parallel. The kernel is launched with at least N threads. Example: ...
pareval_generation_data_61
#include <mpi.h> /* Compute the highest node degree in the undirected graph. The graph is defined in the adjacency matrix A. A is an NxN adjacency matrix stored in row-major. A is an undirected graph. Use MPI to compute in parallel. Assume MPI has already been initialized. Every rank has a complete copy of A....
pareval_generation_data_62
/* Compute the highest node degree in the undirected graph. The graph is defined in the adjacency matrix A. A is an NxN adjacency matrix stored in row-major. A is an undirected graph. Store the result in maxDegree. Use CUDA to compute in parallel. The kernel is launched with at least N threads. Example: ...
pareval_generation_data_63
#include <mpi.h> #include <omp.h> /* Compute the highest node degree in the undirected graph. The graph is defined in the adjacency matrix A. A is an NxN adjacency matrix stored in row-major. A is an undirected graph. Use MPI and OpenMP to compute in parallel. Assume MPI has already been initialized. Every ra...
pareval_generation_data_64
#include <Kokkos_Core.hpp> /* Return the length of the shortest path from source to dest in the undirected graph defined by the adjacency matrix A. A is an NxN adjacency matrix. A is an undirected graph. Use Kokkos to compute in parallel. Assume Kokkos has already been initialized. Example: input: [[0, 1, ...
pareval_generation_data_65
#include <omp.h> /* Return the length of the shortest path from source to dest in the undirected graph defined by the adjacency matrix A. A is an NxN adjacency matrix stored in row-major. A is an undirected graph. Use OpenMP to compute in parallel. Example: input: [[0, 1, 1, 0], [1, 0, 0, 1], [1, 0, 0, 1],...
pareval_generation_data_66
/* Return the length of the shortest path from source to dest in the undirected graph defined by the adjacency matrix A. A is an NxN adjacency matrix stored in row-major. A is an undirected graph. Example: input: [[0, 1, 1, 0], [1, 0, 0, 1], [1, 0, 0, 1], [0, 1, 1, 0]], source=0, dest=3 output: 2 */ int sho...
pareval_generation_data_67
/* Compute the length of the shortest path from source to dest in the undirected graph defined by the adjacency matrix A. A is an NxN adjacency matrix stored in row-major. A is an undirected graph. Store the result in pathLength. Use AMD HIP to compute in parallel. The kernel is launched on an NxN grid of thre...
pareval_generation_data_68
#include <mpi.h> /* Return the length of the shortest path from source to dest in the undirected graph defined by the adjacency matrix A. A is an NxN adjacency matrix stored in row-major. A is an undirected graph. Use MPI to compute in parallel. Assume MPI has already been initialized. Every rank has a comple...
pareval_generation_data_69
/* Compute the length of the shortest path from source to dest in the undirected graph defined by the adjacency matrix A. A is an NxN adjacency matrix stored in row-major. A is an undirected graph. Store the result in pathLength. Use CUDA to compute in parallel. The kernel is launched on an NxN grid of threads...
pareval_generation_data_70
#include <mpi.h> #include <omp.h> /* Return the length of the shortest path from source to dest in the undirected graph defined by the adjacency matrix A. A is an NxN adjacency matrix stored in row-major. A is an undirected graph. Use MPI and OpenMP to compute in parallel. Assume MPI has already been initialized...
pareval_generation_data_71
#include <Kokkos_Core.hpp> /* Return the value of the smallest odd number in the vector x. Use Kokkos to compute in parallel. Assume Kokkos is already initialized. Examples: input: [7, 9, 5, 2, 8, 16, 4, 1] output: 1 input: [8, 36, 7, 2, 11] output: 7 */ int smallestOdd(Kokkos::View<const int*> con...
pareval_generation_data_72
#include <omp.h> /* Return the value of the smallest odd number in the vector x. Use OpenMP to compute in parallel. Examples: input: [7, 9, 5, 2, 8, 16, 4, 1] output: 1 input: [8, 36, 7, 2, 11] output: 7 */ int smallestOdd(std::vector<int> const& x) {
pareval_generation_data_73
/* Return the value of the smallest odd number in the vector x. Examples: input: [7, 9, 5, 2, 8, 16, 4, 1] output: 1 input: [8, 36, 7, 2, 11] output: 7 */ int smallestOdd(std::vector<int> const& x) {
pareval_generation_data_74
/* Find the value of the smallest odd number in the vector x. Store it in smallest. Use AMD HIP to compute in parallel. The kernel is launched with the same number of threads as elements in x. Examples: input: [7, 9, 5, 2, 8, 16, 4, 1] output: 1 input: [8, 36, 7, 2, 11] output: 7 */ __global__ void ...
pareval_generation_data_75
#include <mpi.h> /* Return the value of the smallest odd number in the vector x. Use MPI to compute in parallel. Assume MPI is already initialized. Every rank has a complete copy of x. Return the result on all ranks. Examples: input: [7, 9, 5, 2, 8, 16, 4, 1] output: 1 input: [8, 36, 7, 2, 11] o...
pareval_generation_data_76
/* Find the value of the smallest odd number in the vector x. Store it in smallest. Use CUDA to compute in parallel. The kernel is launched with the same number of threads as elements in x. Examples: input: [7, 9, 5, 2, 8, 16, 4, 1] output: 1 input: [8, 36, 7, 2, 11] output: 7 */ __global__ void sma...
pareval_generation_data_77
#include <mpi.h> #include <omp.h> /* Return the value of the smallest odd number in the vector x. Use MPI and OpenMP to compute in parallel. Assume MPI is already initialized. Every rank has a complete copy of x. Return the result on all ranks. Examples: input: [7, 9, 5, 2, 8, 16, 4, 1] output: 1 i...
pareval_generation_data_78
#include <Kokkos_Core.hpp> /* Return the product of the vector x with every odd indexed element inverted. i.e. x_0 * 1/x_1 * x_2 * 1/x_3 * x_4 ... Use Kokkos to compute product in parallel. Assume Kokkos has already been initialized. Example: input: [4, 2, 10, 4, 5] output: 25 */ double productWithInve...
pareval_generation_data_79
#include <omp.h> /* Return the product of the vector x with every odd indexed element inverted. i.e. x_0 * 1/x_1 * x_2 * 1/x_3 * x_4 ... Use OpenMP to compute product in parallel. Example: input: [4, 2, 10, 4, 5] output: 25 */ double productWithInverses(std::vector<double> const& x) {
pareval_generation_data_80
/* Return the product of the vector x with every odd indexed element inverted. i.e. x_0 * 1/x_1 * x_2 * 1/x_3 * x_4 ... Example: input: [4, 2, 10, 4, 5] output: 25 */ double productWithInverses(std::vector<double> const& x) {
pareval_generation_data_81
/* Return the product of the vector x with every odd indexed element inverted. i.e. x_0 * 1/x_1 * x_2 * 1/x_3 * x_4 ... Store the result in product. Use AMD HIP to compute product in parallel. The kernel is launched with at least as many threads as values in x. Example: input: [4, 2, 10, 4, 5] output...
pareval_generation_data_82
#include <mpi.h> /* Return the product of the vector x with every odd indexed element inverted. i.e. x_0 * 1/x_1 * x_2 * 1/x_3 * x_4 ... Use MPI to compute product in parallel. Assume MPI has already been initialized. Every rank has a complete copy of x. Return the product on all ranks. Example: input:...
pareval_generation_data_83
/* Compute the product of the vector x with every odd indexed element inverted. i.e. x_0 * 1/x_1 * x_2 * 1/x_3 * x_4 ... Store the result in product. Use CUDA to compute product in parallel. The kernel is launched with at least as many threads as values in x. Example: input: [4, 2, 10, 4, 5] output: ...
pareval_generation_data_84
#include <mpi.h> #include <omp.h> /* Return the product of the vector x with every odd indexed element inverted. i.e. x_0 * 1/x_1 * x_2 * 1/x_3 * x_4 ... Use MPI and OpenMP to compute product in parallel. Assume MPI has already been initialized. Every rank has a complete copy of x. Return the product on all r...
pareval_generation_data_85
#include <Kokkos_Core.hpp> /* Return the sum of the minimum value at each index of vectors x and y for all indices. i.e. sum = min(x_0, y_0) + min(x_1, y_1) + min(x_2, y_2) + ... Use Kokkos to sum in parallel. Assume Kokkos has already been initialized. Example: input: x=[3, 4, 0, 2, 3], y=[2, 5, 3, 1, 7]...
pareval_generation_data_86
#include <omp.h> /* Return the sum of the minimum value at each index of vectors x and y for all indices. i.e. sum = min(x_0, y_0) + min(x_1, y_1) + min(x_2, y_2) + ... Use OpenMP to sum in parallel. Example: input: x=[3, 4, 0, 2, 3], y=[2, 5, 3, 1, 7] output: 10 */ double sumOfMinimumElements(std::vec...
pareval_generation_data_87
/* Return the sum of the minimum value at each index of vectors x and y for all indices. i.e. sum = min(x_0, y_0) + min(x_1, y_1) + min(x_2, y_2) + ... Example: input: x=[3, 4, 0, 2, 3], y=[2, 5, 3, 1, 7] output: 10 */ double sumOfMinimumElements(std::vector<double> const& x, std::vector<double> const& y) ...
pareval_generation_data_88
/* Compute the sum of the minimum value at each index of vectors x and y for all indices. i.e. sum = min(x_0, y_0) + min(x_1, y_1) + min(x_2, y_2) + ... Store the result in sum. Use AMD HIP to sum in parallel. The kernel is launched with at least as many threads as values in x. Example: input: x=[3, 4, ...
pareval_generation_data_89
#include <mpi.h> /* Return the sum of the minimum value at each index of vectors x and y for all indices. i.e. sum = min(x_0, y_0) + min(x_1, y_1) + min(x_2, y_2) + ... Use MPI to sum in parallel. Assume MPI has already been initialized. Every rank has a complete copy of x and y. Return the sum on all ranks. ...
pareval_generation_data_90
/* Compute the sum of the minimum value at each index of vectors x and y for all indices. i.e. sum = min(x_0, y_0) + min(x_1, y_1) + min(x_2, y_2) + ... Store the result in sum. Use CUDA to sum in parallel. The kernel is launched with at least as many threads as values in x. Example: input: x=[3, 4, 0, ...
pareval_generation_data_91
#include <mpi.h> #include <omp.h> /* Return the sum of the minimum value at each index of vectors x and y for all indices. i.e. sum = min(x_0, y_0) + min(x_1, y_1) + min(x_2, y_2) + ... Use MPI and OpenMP to sum in parallel. Assume MPI has already been initialized. Every rank has a complete copy of x and y. R...
pareval_generation_data_92
#include <Kokkos_Core.hpp> /* Return the average of the vector x. Use Kokkos to compute in parallel. Assume Kokkos has already been initialized. Examples: input: [1, 8, 4, 5, 1] output: 3.8 input: [2, 2, 2, 3] output: 2.25 */ double average(Kokkos::View<const double*> const& x) {
pareval_generation_data_93
#include <omp.h> /* Return the average of the vector x. Use OpenMP to compute in parallel. Examples: input: [1, 8, 4, 5, 1] output: 3.8 input: [2, 2, 2, 3] output: 2.25 */ double average(std::vector<double> const& x) {
pareval_generation_data_94
/* Return the average of the vector x. Examples: input: [1, 8, 4, 5, 1] output: 3.8 input: [2, 2, 2, 3] output: 2.25 */ double average(std::vector<double> const& x) {
pareval_generation_data_95
/* Compute the average of the vector x. Store the result in average. Use AMD HIP to compute in parallel. The kernel is launched with at least as many threads as values in x. Examples: input: [1, 8, 4, 5, 1] output: 3.8 input: [2, 2, 2, 3] output: 2.25 */ __global__ void average(const double *x, si...
pareval_generation_data_96
#include <mpi.h> /* Return the average of the vector x. Use MPI to compute in parallel. Assume MPI has already been initialized. Every rank has a complete copy of x. Return the average on all ranks. Examples: input: [1, 8, 4, 5, 1] output: 3.8 input: [2, 2, 2, 3] output: 2.25 */ double average(...
pareval_generation_data_97
/* Compute the average of the vector x. Store the result in average. Use CUDA to compute in parallel. The kernel is launched with at least as many threads as values in x. Examples: input: [1, 8, 4, 5, 1] output: 3.8 input: [2, 2, 2, 3] output: 2.25 */ __global__ void average(const double *x, size_...
pareval_generation_data_98
#include <mpi.h> #include <omp.h> /* Return the average of the vector x. Use MPI and OpenMP to compute in parallel. Assume MPI has already been initialized. Every rank has a complete copy of x. Return the average on all ranks. Examples: input: [1, 8, 4, 5, 1] output: 3.8 input: [2, 2, 2, 3] out...
pareval_generation_data_99
#include <Kokkos_Core.hpp> /* Return the logical XOR reduction of the vector of bools x. Use Kokkos to reduce in parallel. Assume Kokkos is already initialized. Example: input: [false, false, false, true] output: true */ bool reduceLogicalXOR(Kokkos::View<const bool*> const& x) {
pareval_generation_data_100
#include <omp.h> /* Return the logical XOR reduction of the vector of bools x. Use OpenMP to reduce in parallel. Example: input: [false, false, false, true] output: true */ bool reduceLogicalXOR(std::vector<bool> const& x) {