00001 #ifndef FUPERMOD_HYBRID_H_
00002 #define FUPERMOD_HYBRID_H_
00003 #include "fupermod/fupermod_dynamic.h"
00004 #include "mm_col_distr.h"
00005
00006 #ifdef __cplusplus
00007 extern "C" {
00008 #endif
00009
00010 #define ROUNDUP 1.1
00011 #define HYBRID_MEMORY 0
00012
00013 #ifdef HAVE_LIBDGEMMHYB
00014 #include <dgemm_hybrid.h>
00015 #include <memory_hybrid.h>
00016 #else
00017 typedef enum { CPU_ONLY, GPU_ONLY, HYBRID } environmentType;
00018
00019 typedef enum { PAGEABLE, PINNED, PINNEDWC } memoryMode;
00020
00021 typedef struct call_config {
00022 environmentType EnvType;
00023 int numGPUs;
00024 int numCPUs;
00025 int *deviceWorkload;
00026 double *deviceTime;
00027 int iterations;
00028 int verbose;
00029 } HybridConfig;
00030
00031 typedef struct mxm_col_params {
00032 HybridConfig hybridconf;
00033 int N;
00034 int kb;
00035 double time;
00036 } mxm_col_params;
00037
00038
00039 typedef struct fupermod_benchmark_hybrid {
00040 fupermod_benchmark base;
00041 mxm_col_params params;
00042 mm_col_i_distrib* mm_col_dist;
00043 fupermod_partitioner partitioner;
00044 int iters;
00045 double eps;
00046 } fupermod_benchmark_hybrid;
00047 #endif
00048
00049 int hybrid_nodedist_read(char* nodedist_path, HybridConfig* hybridconf);
00050 int hybrid_nodedist_write(char* nodedist_path, HybridConfig* hybridconf);
00051 int hybrid_nodetype_read(char* nodetype_path, HybridConfig* hybridconf);
00052 int fupermod_hybrid_partition_node(struct fupermod_benchmark_hybrid* hybrid, int N);
00053 int fupermod_hybrid_partition_node_2D(struct fupermod_benchmark* benchmark, int M, int N, fupermod_precision precision, HybridConfig* config);
00054
00057 fupermod_benchmark_hybrid* fupermod_benchmark_hybrid_alloc(fupermod_kernel* kernel, HybridConfig* config, int N, int kb, int iters, double eps, fupermod_partitioner partitioner);
00058
00060 void fupermod_benchmark_hybrid_free(fupermod_benchmark_hybrid* benchmark);
00061
00062 #ifdef __cplusplus
00063 }
00064 #endif
00065
00066 #endif