Objet : Developers list for StarPU
Archives de la liste
- From: Jonathan Adamczewski <jadamcze@utas.edu.au>
- To: Cedric Augonnet <cedric.augonnet@inria.fr>
- Cc: starpu-devel@lists.gforge.inria.fr
- Subject: Re: [Starpu-devel] Building starpu examples with MSVC
- Date: Thu, 31 Mar 2011 23:58:12 +1100
- List-archive: <http://lists.gforge.inria.fr/pipermail/starpu-devel>
- List-id: "Developers list. For discussion of new features, code changes, etc." <starpu-devel.lists.gforge.inria.fr>
Some patches:
00_c89_headers.diff:
Fixes comment style in files in the include directory to allow compiling as strict c89.
01_c89_examples.diff:
Obvious fixes to example sources to compile as strict c89.
02_c89_examples_warnings.diff:
Remove some unused-but-set variables in example sources.
03_c89_examples_makefiles.diff:
Add -std=c89 to Makefile.am files in examples directory. Probably should not be applied yet - I am not set up to build the CUDA examples, so don't know if more warnings/errors are yet to be uncovered.
04_c89_gcc_subtler.diff: (this patch is not ready to be applied)
Fixes for a couple of subtler c89 limitations: ffs() and sqrtf() are not available when compiling with -std=c89.
For sqrtf(), I've added an #ifdef block that will should be correct for msvc and gcc.
For ffs(), I've used __builtin_ffs(), which won't work with msvc. Not sure what the best solution is here.
There should be no problems caused by applying the first three diffs. I would appreciate comments on the last two.
jonathan.
Index: include/starpu_task_list.h
===================================================================
--- include/starpu_task_list.h (revision 3417)
+++ include/starpu_task_list.h (working copy)
@@ -51,4 +51,4 @@
/* Remove the element at the back of the list */
struct starpu_task *starpu_task_list_pop_back(struct starpu_task_list *list);
-#endif // __STARPU_TASK_LIST_H__
+#endif /* __STARPU_TASK_LIST_H__ */
Index: include/starpu_task.h
===================================================================
--- include/starpu_task.h (revision 3417)
+++ include/starpu_task.h (working copy)
@@ -265,4 +265,4 @@
}
#endif
-#endif // __STARPU_TASK_H__
+#endif /* __STARPU_TASK_H__ */
Index: include/starpu_expert.h
===================================================================
--- include/starpu_expert.h (revision 3417)
+++ include/starpu_expert.h (working copy)
@@ -33,4 +33,4 @@
}
#endif
-#endif // __STARPU_H__
+#endif /* __STARPU_H__ */
Index: include/starpu_data.h
===================================================================
--- include/starpu_data.h (revision 3417)
+++ include/starpu_data.h (working copy)
@@ -97,4 +97,4 @@
}
#endif
-#endif // __STARPU_DATA_H__
+#endif /* __STARPU_DATA_H__ */
Index: include/starpu_cuda.h
===================================================================
--- include/starpu_cuda.h (revision 3417)
+++ include/starpu_cuda.h (working copy)
@@ -85,6 +85,6 @@
}
#endif
-#endif // STARPU_USE_CUDA
-#endif // __STARPU_CUDA_H__
+#endif /* STARPU_USE_CUDA */
+#endif /* __STARPU_CUDA_H__ */
Index: include/starpu_data_interfaces.h
===================================================================
--- include/starpu_data_interfaces.h (revision 3417)
+++ include/starpu_data_interfaces.h (working copy)
@@ -259,7 +259,7 @@
uintptr_t nzval; /* non-zero values */
uint32_t *colind; /* position of non-zero entried on the row */
-// uint32_t *rowind; /* position of non-zero entried on the col */
+/* uint32_t *rowind; */ /* position of non-zero entried on the col */
uint32_t *rowptr; /* index (in nzval) of the first entry of the row */
/* k for k-based indexing (0 or 1 usually) */
@@ -302,4 +302,4 @@
}
#endif
-#endif // __STARPU_DATA_INTERFACES_H__
+#endif /* __STARPU_DATA_INTERFACES_H__ */
Index: include/starpu_perfmodel.h
===================================================================
--- include/starpu_perfmodel.h (revision 3417)
+++ include/starpu_perfmodel.h (working copy)
@@ -130,4 +130,4 @@
}
#endif
-#endif // __STARPU_PERFMODEL_H__
+#endif /* __STARPU_PERFMODEL_H__ */
Index: include/starpu_util.h
===================================================================
--- include/starpu_util.h (revision 3417)
+++ include/starpu_util.h (working copy)
@@ -58,6 +58,9 @@
#endif
#if defined(__i386__) || defined(__x86_64__)
+
+#define inline __inline
+
static inline unsigned starpu_cmpxchg(unsigned *ptr, unsigned old, unsigned
next) {
__asm__ __volatile__("lock cmpxchgl %2,%1": "+a" (old), "+m" (*ptr) :
"q" (next) : "memory");
return old;
@@ -133,12 +136,12 @@
val = (int)strtol(strval, &check, 10);
STARPU_ASSERT(strcmp(check, "\0") == 0);
- //fprintf(stderr, "ENV %s WAS %d\n", str, val);
+ /* fprintf(stderr, "ENV %s WAS %d\n", str, val); */
return val;
}
else {
/* there is no such env variable */
- //fprintf("There was no %s ENV\n", str);
+ /* fprintf("There was no %s ENV\n", str); */
return -1;
}
}
@@ -216,4 +219,4 @@
}
#endif
-#endif // __STARPU_UTIL_H__
+#endif /* __STARPU_UTIL_H__ */
Index: include/starpu_scheduler.h
===================================================================
--- include/starpu_scheduler.h (revision 3417)
+++ include/starpu_scheduler.h (working copy)
@@ -182,4 +182,4 @@
/* Returns expected power consumption in J */
double starpu_task_expected_power(struct starpu_task *task, enum
starpu_perf_archtype arch);
-#endif // __STARPU_SCHEDULER_H__
+#endif /* __STARPU_SCHEDULER_H__ */
Index: include/starpu.h
===================================================================
--- include/starpu.h (revision 3417)
+++ include/starpu.h (working copy)
@@ -148,4 +148,4 @@
}
#endif
-#endif // __STARPU_H__
+#endif /* __STARPU_H__ */
Index: include/starpu_opencl.h
===================================================================
--- include/starpu_opencl.h (revision 3417)
+++ include/starpu_opencl.h (working copy)
@@ -208,6 +208,6 @@
}
#endif
-#endif // STARPU_USE_OPENCL
-#endif // __STARPU_OPENCL_H__
+#endif /* STARPU_USE_OPENCL */
+#endif /* __STARPU_OPENCL_H__ */
Index: include/starpu_profiling.h
===================================================================
--- include/starpu_profiling.h (revision 3417)
+++ include/starpu_profiling.h (working copy)
@@ -175,4 +175,4 @@
}
#endif
-#endif // __STARPU_PROFILING_H__
+#endif /* __STARPU_PROFILING_H__ */
Index: examples/basic_examples/hello_world.c
===================================================================
--- examples/basic_examples/hello_world.c (revision 3417)
+++ examples/basic_examples/hello_world.c (working copy)
@@ -57,19 +57,13 @@
FPRINTF(stdout, "Hello world (params = {%i, %f} )\n", params->i,
params->f);
}
-starpu_codelet cl =
-{
- /* this codelet may only be executed on a CPU, and its cpu
- * implementation is function "cpu_func" */
- .where = STARPU_CPU,
- .cpu_func = cpu_func,
- /* the codelet does not manipulate any data that is managed
- * by our DSM */
- .nbuffers = 0
-};
+starpu_codelet cl;
int main(int argc, char **argv)
{
+ struct starpu_task *task;
+ struct params params = {1, 2.0f};
+
/* initialize StarPU : passing a NULL argument means that we use
* default configuration for the scheduling policies and the number of
* processors/accelerators */
@@ -78,8 +72,16 @@
/* create a new task that is non-blocking by default : the task is not
* submitted to the scheduler until the starpu_task_submit function is
* called */
- struct starpu_task *task = starpu_task_create();
+ task = starpu_task_create();
+ /* this codelet may only be executed on a CPU, and its cpu
+ * implementation is function "cpu_func" */
+ cl.where = STARPU_CPU;
+ cl.cpu_func = cpu_func;
+ /* the codelet does not manipulate any data that is managed
+ * by our DSM */
+ cl.nbuffers = 0;
+
/* the task uses codelet "cl" */
task->cl = &cl;
@@ -91,7 +93,6 @@
* is read-only so that any modification is not passed to other copies
* of the buffer. For this reason, a buffer passed as a codelet
* argument (cl_arg) is NOT a valid synchronization medium! */
- struct params params = { 1, 2.0f };
task->cl_arg = ¶ms;
task->cl_arg_size = sizeof(params);
Index: examples/basic_examples/block.c
===================================================================
--- examples/basic_examples/block.c (revision 3417)
+++ examples/basic_examples/block.c (working copy)
@@ -109,7 +109,7 @@
if (!ret) multiplier *= 3.0;
#endif
- // Check result is correct
+ /* Check result is correct */
ret=1;
for(i=0 ; i<nx*ny*nz ; i++) {
if (block[i] != (i+1) * multiplier) {
Index: examples/spmv/dw_spmv.h
===================================================================
--- examples/spmv/dw_spmv.h (revision 3417)
+++ examples/spmv/dw_spmv.h (working copy)
@@ -29,4 +29,4 @@
#include <starpu.h>
-#endif // __DW_SPARSE_CG_H__
+#endif /* __DW_SPARSE_CG_H__ */
Index: examples/tag_example/tag_restartable.c
===================================================================
--- examples/tag_example/tag_restartable.c (revision 3417)
+++ examples/tag_example/tag_restartable.c (working copy)
@@ -98,7 +98,7 @@
{
unsigned i;
- //FPRINTF(stderr, "start grid %d ni %d...\n", iter, ni);
+ /* FPRINTF(stderr, "start grid %d ni %d...\n", iter, ni); */
for (i = 0; i < ni; i++)
starpu_task_submit(tasks[iter][i]);
@@ -106,10 +106,11 @@
void cpu_codelet(void *descr[], void *_args __attribute__((unused)))
{
- //int i = (uintptr_t) _args;
- //printf("doing %x\n", i);
- //usleep(SLEEP);
- //printf("done %x\n", i);
+/* int i = (uintptr_t) _args;
+ printf("doing %x\n", i);
+ usleep(SLEEP);
+ printf("done %x\n", i);
+*/
}
int main(int argc __attribute__((unused)) , char **argv
__attribute__((unused)))
Index: examples/tag_example/tag_example.c
===================================================================
--- examples/tag_example/tag_example.c (revision 3417)
+++ examples/tag_example/tag_example.c (working copy)
@@ -79,13 +79,13 @@
}
-}
+}
static void create_task_grid(unsigned iter)
{
unsigned i, j;
-// FPRINTF(stderr, "start iter %d...\n", iter);
+/* FPRINTF(stderr, "start iter %d...\n", iter); */
callback_cnt = (ni*nj);
/* create non-entry tasks */
@@ -95,16 +95,16 @@
/* create a new task */
struct starpu_task *task = starpu_task_create();
task->callback_func = callback_cpu;
- //jb->argcb = &coords[i][j];
+ /* jb->argcb = &coords[i][j]; */
task->cl = &cl;
task->cl_arg = NULL;
task->use_tag = 1;
task->tag_id = TAG(i, j, iter);
- /* express deps : (i,j) depends on (i-1, j-1) & (i-1, j+1) */
+ /* express deps : (i,j) depends on (i-1, j-1) & (i-1, j+1) */
express_deps(i, j, iter);
-
+
starpu_task_submit(task);
}
@@ -129,7 +129,7 @@
void callback_cpu(void *argcb __attribute__ ((unused)))
{
- unsigned newcnt = STARPU_ATOMIC_ADD(&callback_cnt, -1);
+ unsigned newcnt = STARPU_ATOMIC_ADD(&callback_cnt, -1);
if (newcnt == 0)
{
@@ -148,7 +148,7 @@
void cpu_codelet(void *descr[] __attribute__((unused)),
void *_args __attribute__ ((unused)))
{
-// printf("execute task\n");
+/* printf("execute task\n"); */
}
static void express_deps(unsigned i, unsigned j, unsigned iter)
@@ -160,7 +160,7 @@
/* (i,j+1) exists */
starpu_tag_declare_deps(TAG(i,j,iter), 2,
TAG(i-1,j-1,iter), TAG(i-1,j+1,iter));
}
- else
+ else
{
/* (i,j+1) does not exist */
starpu_tag_declare_deps(TAG(i,j,iter), 1,
TAG(i-1,j-1,iter));
@@ -173,7 +173,7 @@
/* (i,j+1) exists */
starpu_tag_declare_deps(TAG(i,j,iter), 1,
TAG(i-1,j+1,iter));
}
- else
+ else
{
/* (i,j+1) does not exist */
STARPU_ABORT();
Index: examples/tag_example/tag_example2.c
===================================================================
--- examples/tag_example/tag_example2.c (revision 3417)
+++ examples/tag_example/tag_example2.c (working copy)
@@ -64,13 +64,13 @@
unsigned i;
for (i = 0; i < ni; i++)
starpu_tag_remove(TAG(i,it));
-}
+}
static void create_task_grid(unsigned it)
{
unsigned i;
-// FPRINTF(stderr, "start iter %d ni %d...\n", it, ni);
+/* FPRINTF(stderr, "start iter %d ni %d...\n", it, ni); */
for (i = 0; i < ni; i++)
{
Index: examples/tag_example/tag_example3.c
===================================================================
--- examples/tag_example/tag_example3.c (revision 3417)
+++ examples/tag_example/tag_example3.c (working copy)
@@ -70,13 +70,13 @@
}
-}
+}
static void create_task_grid(unsigned iter)
{
int i;
-// FPRINTF(stderr, "start iter %d ni %d...\n", iter, ni);
+/* FPRINTF(stderr, "start iter %d ni %d...\n", iter, ni); */
callback_cnt = (ni);
Index: examples/mandelbrot/mandelbrot.c
===================================================================
--- examples/mandelbrot/mandelbrot.c (revision 3417)
+++ examples/mandelbrot/mandelbrot.c (working copy)
@@ -35,8 +35,8 @@
static int nblocks = 20;
static int height = 400;
static int width = 640;
-static int maxIt = 20000; // max number of iteration in the Mandelbrot
function
-static int niter = -1; // number of loops in case we don't use X11, -1 means
infinite
+static int maxIt = 20000; /* max number of iteration in the Mandelbrot
function */
+static int niter = -1; /* number of loops in case we don't use X11, -1 means
infinite */
static int use_spmd = 0;
static double leftX = -0.745;
@@ -233,7 +233,7 @@
{
int iby, block_size;
double stepX, stepY;
- int *pcnt; // unused for CUDA tasks
+ int *pcnt; /* unused for CUDA tasks */
starpu_unpack_cl_args(cl_arg, &iby, &block_size, &stepX, &stepY,
&pcnt);
cl_mem data = (cl_mem)STARPU_VECTOR_GET_PTR(descr[0]);
@@ -278,7 +278,7 @@
int iby, block_size;
double stepX, stepY;
- int *pcnt; // unused for sequential tasks
+ int *pcnt; /* unused for sequential tasks */
starpu_unpack_cl_args(cl_arg, &iby, &block_size, &stepX, &stepY,
&pcnt);
unsigned *data = (unsigned *)STARPU_VECTOR_GET_PTR(descr[0]);
@@ -291,7 +291,7 @@
{
double cx = leftX + ix * stepX;
double cy = topY - iy * stepY;
- // Z = X+I*Y
+ /* Z = X+I*Y */
double x = 0;
double y = 0;
int it;
@@ -300,13 +300,13 @@
double x2 = x*x;
double y2 = y*y;
- // Stop iterations when |Z| > 2
+ /* Stop iterations when |Z| > 2 */
if (x2 + y2 > 4.0)
break;
double twoxy = 2.0*x*y;
- // Z = Z^2 + C
+ /* Z = Z^2 + C */
x = x2 - y2 + cx;
y = twoxy + cy;
}
@@ -327,8 +327,8 @@
unsigned *data = (unsigned *)STARPU_VECTOR_GET_PTR(descr[0]);
- int ix, iy; // global coordinates
- int local_iy; // current line
+ int ix, iy; /* global coordinates */
+ int local_iy; /* current line */
while (1)
{
@@ -342,7 +342,7 @@
{
double cx = leftX + ix * stepX;
double cy = topY - iy * stepY;
- // Z = X+I*Y
+ /* Z = X+I*Y */
double x = 0;
double y = 0;
int it;
@@ -351,13 +351,13 @@
double x2 = x*x;
double y2 = y*y;
- // Stop iterations when |Z| > 2
+ /* Stop iterations when |Z| > 2 */
if (x2 + y2 > 4.0)
break;
double twoxy = 2.0*x*y;
- // Z = Z^2 + C
+ /* Z = Z^2 + C */
x = x2 - y2 + cx;
y = twoxy + cy;
}
@@ -583,7 +583,7 @@
for (iby = 0; iby < nblocks; iby++)
starpu_data_unregister(block_handles[iby]);
-// starpu_data_free_pinned_if_possible(buffer);
+/* starpu_data_free_pinned_if_possible(buffer); */
starpu_shutdown();
Index: examples/stencil/stencil.c
===================================================================
--- examples/stencil/stencil.c (revision 3417)
+++ examples/stencil/stencil.c (working copy)
@@ -230,7 +230,7 @@
check(rank);
#endif
- //display_debug(nbz, niter, rank);
+ /*display_debug(nbz, niter, rank);*/
#ifdef STARPU_USE_MPI
starpu_mpi_shutdown();
Index: examples/stencil/stencil.h
===================================================================
--- examples/stencil/stencil.h (revision 3417)
+++ examples/stencil/stencil.h (working copy)
@@ -137,4 +137,4 @@
_externC void cuda_life_update_host(int bz, const TYPE *old, TYPE *newp, int
nx, int ny, int nz, int ldy, int ldz, int iter);
_externC void cuda_shadow_host(int bz, TYPE *ptr, int nx, int ny, int nz,
int ldy, int ldz, int i);
-#endif // __STENCIL_H__
+#endif /* __STENCIL_H__ */
Index: examples/stencil/stencil-blocks.c
===================================================================
--- examples/stencil/stencil-blocks.c (revision 3417)
+++ examples/stencil/stencil-blocks.c (working copy)
@@ -168,7 +168,7 @@
/* NB: perhaps we could count a GPU as multiple workers */
/* how many workers are there ? */
- //unsigned nworkers = starpu_worker_get_count();
+ /*unsigned nworkers = starpu_worker_get_count();*/
/* how many blocks are on that MPI node ? */
unsigned nblocks = 0;
@@ -182,7 +182,7 @@
}
/* how many blocks per worker ? */
- // unsigned nblocks_per_worker = (nblocks + nworkers -
1)/nworkers;
+ /*unsigned nblocks_per_worker = (nblocks + nworkers - 1)/nworkers;*/
/* we now attribute up to nblocks_per_worker blocks per workers */
unsigned attributed = 0;
@@ -215,7 +215,7 @@
/* Only GPUS */
workerid = (attributed / 21) % 3;
#endif
- //= attributed/nblocks_per_worker;
+ /*= attributed/nblocks_per_worker;*/
block->preferred_worker = workerid;
@@ -294,7 +294,7 @@
for (z = 0; z < size_bz; z++)
/* Just random data */
sum +=
block->layers[0][(K+x)+(K+y)*(sizex + 2*K)+(K+z)*(sizex+2*K)*(sizey+2*K)] =
(int)((x/7.+y/13.+(bz*size_bz + z)/17.) * 10.) % 2;
-// printf("block %d starts with %d/%d alive\n", bz, sum,
sizex*sizey*size_bz);
+/* printf("block %d starts with %d/%d alive\n", bz, sum,
sizex*sizey*size_bz);*/
#endif
allocate_block_on_node(&block->layers_handle[1],
&block->layers[1],
(sizex + 2*K), (sizey + 2*K),
(size_bz + 2*K));
Index: examples/stencil/life_opencl.c
===================================================================
--- examples/stencil/life_opencl.c (revision 3417)
+++ examples/stencil/life_opencl.c (working copy)
@@ -16,7 +16,7 @@
/* Heart of the stencil computation: compute a new state from an old one. */
-//#define _externC extern "C"
+/* #define _externC extern "C" */
#include <stencil.h>
#include <CL/cl.h>
Index: examples/stencil/stencil-tasks.c
===================================================================
--- examples/stencil/stencil-tasks.c (revision 3417)
+++ examples/stencil/stencil-tasks.c (working copy)
@@ -125,7 +125,7 @@
starpu_mpi_irecv_detached(handle0, source, MPI_TAG0(z, iter, dir),
MPI_COMM_WORLD, recv_done, (void*)(uintptr_t)z);
starpu_mpi_irecv_detached(handle1, source, MPI_TAG1(z, iter, dir),
MPI_COMM_WORLD, recv_done, (void*)(uintptr_t)z);
}
-#endif // STARPU_USE_MPI
+#endif /* STARPU_USE_MPI */
/*
* Schedule saving boundaries of blocks to communication buffers
@@ -141,26 +141,26 @@
/* Save data from update */
create_task_save_local(iter, z, dir, local_rank);
if (node_z_and_d != local_rank)
- { // R(z) = local & R(z+d) != local, We have to send the data
+ { /* R(z) = local & R(z+d) != local, We have to send the data
*/
create_task_save_mpi_send(iter, z, dir, local_rank);
}
}
- else { // node_z != local_rank, this MPI node doesn't have the saved
data
+ else { /* node_z != local_rank, this MPI node doesn't have the saved
data */
if (node_z_and_d == local_rank)
{
create_task_save_mpi_recv(iter, z, dir, local_rank);
}
- else { // R(z) != local & R(z+d) != local We don't have
- // the saved data and don't need it, we shouldn't
- // even have been called!
+ else { /* R(z) != local & R(z+d) != local We don't have
+ the saved data and don't need it, we shouldn't
+ even have been called! */
STARPU_ASSERT(0);
}
}
-#else // !STARPU_USE_MPI
+#else /* !STARPU_USE_MPI */
STARPU_ASSERT((node_z == local_rank) && (node_z_and_d == local_rank));
create_task_save_local(iter, z, dir, local_rank);
-#endif // STARPU_USE_MPI
+#endif /* STARPU_USE_MPI */
}
/*
Index: examples/pi/SobolQRNG/sobol_primitives.h
===================================================================
--- examples/pi/SobolQRNG/sobol_primitives.h (revision 3417)
+++ examples/pi/SobolQRNG/sobol_primitives.h (working copy)
@@ -57,11 +57,11 @@
#define max_m 17
-// Each primitive is stored as a struct where
-// dimension is the dimension number of the polynomial (unused)
-// degree is the degree of the polynomial
-// a is a binary word representing the coefficients
-// m is the array of m values
+/* Each primitive is stored as a struct where
+ dimension is the dimension number of the polynomial (unused)
+ degree is the degree of the polynomial
+ a is a binary word representing the coefficients
+ m is the array of m values */
struct primitive
{
unsigned int dimension;
Index: examples/pi/SobolQRNG/sobol.h
===================================================================
--- examples/pi/SobolQRNG/sobol.h (revision 3417)
+++ examples/pi/SobolQRNG/sobol.h (working copy)
@@ -54,7 +54,7 @@
#ifndef SOBOL_H
#define SOBOL_H
-// Number of direction vectors is fixed to 32
+/* Number of direction vectors is fixed to 32 */
#define n_directions 32
#endif
Index: examples/pi/SobolQRNG/sobol_primitives.c
===================================================================
--- examples/pi/SobolQRNG/sobol_primitives.c (revision 3417)
+++ examples/pi/SobolQRNG/sobol_primitives.c (working copy)
@@ -54,18 +54,18 @@
#include "sobol_primitives.h"
-// Each primitive is stored as a struct where
-// dimension is the dimension number of the polynomial (unused)
-// degree is the degree of the polynomial
-// a is a binary word representing the coefficients
-// m is the array of m values
+/* Each primitive is stored as a struct where
+ dimension is the dimension number of the polynomial (unused)
+ degree is the degree of the polynomial
+ a is a binary word representing the coefficients
+ m is the array of m values
-// The primitives are based on those generated by Stephen Joe and
-// Frances Kuo in the joe-kuo-6.10200 set.
-// c.f. http://web.maths.unsw.edu.au/~fkuo/sobol/index.html
+ The primitives are based on those generated by Stephen Joe and
+ Frances Kuo in the joe-kuo-6.10200 set.
+ c.f. http://web.maths.unsw.edu.au/~fkuo/sobol/index.html */
const struct primitive sobol_primitives[] =
{
- // First dimension is a special case so this entry is actually ignored
+ /* First dimension is a special case so this entry is actually ignored */
{1, 0, 0, {}},
{2, 1, 0, {1}},
{3, 2, 1, {1, 3}},
@@ -10266,6 +10266,6 @@
{10198, 17, 38018, {1, 3, 7, 13, 5, 49, 61, 123, 443, 769, 1669, 2741,
6881, 5965, 9365, 43051, 2979}},
{10199, 17, 38020, {1, 1, 1, 7, 7, 25, 41, 179, 419, 225, 1827, 613,
4711, 1671, 14459, 33951, 56751}},
{10200, 17, 38038, {1, 3, 5, 7, 9, 61, 35, 205, 243, 49, 803, 2653,
4101, 4435, 29697, 45441, 124841}}
- // Extending this table?
- // Ensure that the max_m defined in sobol_primitives.h is sufficient for
all the m values
+ /* Extending this table?
+ Ensure that the max_m defined in sobol_primitives.h is sufficient for
all the m values */
};
Index: examples/pi/pi.h
===================================================================
--- examples/pi/pi.h (revision 3417)
+++ examples/pi/pi.h (working copy)
@@ -26,8 +26,8 @@
#define TYPE float
-//extern "C" void cuda_kernel(void *descr[], void *cl_arg);
+/* extern "C" void cuda_kernel(void *descr[], void *cl_arg); */
static int n_dimensions = 100;
-#endif // __PI_H__
+#endif /* __PI_H__ */
Index: examples/ppm_downscaler/yuv_downscaler.c
===================================================================
--- examples/ppm_downscaler/yuv_downscaler.c (revision 3417)
+++ examples/ppm_downscaler/yuv_downscaler.c (working copy)
@@ -111,7 +111,7 @@
parse_args(argc, argv);
-// fprintf(stderr, "Reading input file ...\n");
+/* fprintf(stderr, "Reading input file ...\n"); */
/* how many frames ? */
struct stat stbuf;
@@ -120,7 +120,7 @@
unsigned nframes = filesize/FRAMESIZE;
-// fprintf(stderr, "filesize %lx (FRAME SIZE %lx NEW SIZE %lx); nframes
%d\n", filesize, FRAMESIZE, NEW_FRAMESIZE, nframes);
+/* fprintf(stderr, "filesize %lx (FRAME SIZE %lx NEW SIZE %lx); nframes
%d\n", filesize, FRAMESIZE, NEW_FRAMESIZE, nframes); */
assert((filesize % sizeof(struct yuv_frame)) == 0);
/* fetch input data */
@@ -134,7 +134,7 @@
FILE *f_out = fopen(filename_out, "w+");
assert(f_out);
-// fprintf(stderr, "Alloc output file ...\n");
+/* fprintf(stderr, "Alloc output file ...\n"); */
struct yuv_new_frame *yuv_out_buffer = calloc(nframes, NEW_FRAMESIZE);
assert(yuv_out_buffer);
Index: examples/ppm_downscaler/ppm_downscaler.c
===================================================================
--- examples/ppm_downscaler/ppm_downscaler.c (revision 3417)
+++ examples/ppm_downscaler/ppm_downscaler.c (working copy)
@@ -76,7 +76,7 @@
unsigned i;
for (i = 0; i < ppm->ncols*ppm->nlines; i++)
{
-// fprintf(stderr, "READ (index %d) -> r %d g %d b %d\n", i,
ppm->data[i].r, ppm->data[i].g, ppm->data[i].b);
+/* fprintf(stderr, "READ (index %d) -> r %d g %d b %d\n", i,
ppm->data[i].r, ppm->data[i].g, ppm->data[i].b); */
}
fclose(file);
@@ -136,7 +136,7 @@
{
unsigned index = (big_col +
i)+(big_line + j)*input_ppm->ncols;
-// fprintf(stderr, "(col %d, line %d) i
%d j %d index %d -> r %d g %d b %d\n", col, line, i, j, index, in[index].r,
in[index].g, in[index].b);
+/* fprintf(stderr, "(col %d, line %d) i
%d j %d index %d -> r %d g %d b %d\n", col, line, i, j, index, in[index].r,
in[index].g, in[index].b); */
sum_r += (unsigned)in[index].r;
sum_g += (unsigned)in[index].g;
@@ -148,7 +148,7 @@
out[col + line*output_ppm->ncols].g = (unsigned
char)(sum_g/(FACTOR*FACTOR));
out[col + line*output_ppm->ncols].b = (unsigned
char)(sum_b/(FACTOR*FACTOR));
-// fprintf(stderr, "col %d line %d -> sum_r = %d out ->
%d\n", col, line, sum_r, out[col + line*FACTOR].r);
+/* fprintf(stderr, "col %d line %d -> sum_r = %d out ->
%d\n", col, line, sum_r, out[col + line*FACTOR].r); */
}
}
Index: examples/starpufft/starpufftx1d.c
===================================================================
--- examples/starpufft/starpufftx1d.c (revision 3417)
+++ examples/starpufft/starpufftx1d.c (working copy)
@@ -166,7 +166,7 @@
STARPUFFT(complex) * restrict in = (STARPUFFT(complex)
*)STARPU_VECTOR_GET_PTR(descr[0]);
STARPUFFT(complex) * restrict twisted1 = (STARPUFFT(complex)
*)STARPU_VECTOR_GET_PTR(descr[1]);
- //printf("twist1 %d %g\n", i, (double) cabs(plan->in[i]));
+ /* printf("twist1 %d %g\n", i, (double) cabs(plan->in[i])); */
for (j = 0; j < n2; j++)
twisted1[j] = in[i+j*n1];
@@ -194,7 +194,7 @@
_fftw_complex * restrict worker_in1 = (STARPUFFT(complex)
*)plan->plans[workerid].in1;
_fftw_complex * restrict worker_out1 = (STARPUFFT(complex)
*)plan->plans[workerid].out1;
- //printf("fft1 %d %g\n", i, (double) cabs(twisted1[0]));
+ /* printf("fft1 %d %g\n", i, (double) cabs(twisted1[0])); */
memcpy(worker_in1, twisted1, plan->totsize2 * sizeof(*worker_in1));
_FFTW(execute)(plan->plans[workerid].plan1_cpu);
@@ -223,7 +223,7 @@
STARPUFFT(complex) * restrict twisted2 = (STARPUFFT(complex)
*)STARPU_VECTOR_GET_PTR(descr[0]);
- //printf("twist2 %d %g\n", jj, (double) cabs(plan->fft1[jj]));
+ /* printf("twist2 %d %g\n", jj, (double) cabs(plan->fft1[jj])); */
for (jjj = 0; jjj < n3; jjj++) {
int j = jj * n3 + jjj;
@@ -241,7 +241,7 @@
{
struct STARPUFFT(args) *args = _args;
STARPUFFT(plan) plan = args->plan;
- //int jj = args->jj;
+ /* int jj = args->jj; */
int workerid = starpu_worker_get_id();
task_per_worker[workerid]++;
@@ -249,7 +249,7 @@
const STARPUFFT(complex) * restrict twisted2 = (STARPUFFT(complex)
*)STARPU_VECTOR_GET_PTR(descr[0]);
STARPUFFT(complex) * restrict fft2 = (STARPUFFT(complex)
*)STARPU_VECTOR_GET_PTR(descr[1]);
- //printf("fft2 %d %g\n", jj, (double)
cabs(twisted2[plan->totsize4-1]));
+ /* printf("fft2 %d %g\n", jj, (double)
cabs(twisted2[plan->totsize4-1])); */
_fftw_complex * restrict worker_in2 = (STARPUFFT(complex)
*)plan->plans[workerid].in2;
_fftw_complex * restrict worker_out2 = (STARPUFFT(complex)
*)plan->plans[workerid].out2;
@@ -278,7 +278,7 @@
const STARPUFFT(complex) * restrict fft2 = (STARPUFFT(complex)
*)STARPU_VECTOR_GET_PTR(descr[0]);
- //printf("twist3 %d %g\n", jj, (double) cabs(fft2[0]));
+ /* printf("twist3 %d %g\n", jj, (double) cabs(fft2[0])); */
for (jjj = 0; jjj < n3; jjj++) {
int j = jj * n3 + jjj;
@@ -541,8 +541,8 @@
/* Create twist1 task */
plan->twist1_tasks[z] = task = starpu_task_create();
task->cl = &STARPUFFT(twist1_1d_codelet);
- //task->buffers[0].handle = to be filled at execution to point
- //to the application input.
+ /* task->buffers[0].handle = to be filled at execution to
point
+ to the application input. */
task->buffers[0].mode = STARPU_R;
task->buffers[1].handle = plan->twisted1_handle[z];
task->buffers[1].mode = STARPU_W;
Index: examples/starpufft/starpufftx2d.c
===================================================================
--- examples/starpufft/starpufftx2d.c (revision 3417)
+++ examples/starpufft/starpufftx2d.c (working copy)
@@ -140,7 +140,7 @@
STARPUFFT(complex) * restrict in = (STARPUFFT(complex)
*)STARPU_VECTOR_GET_PTR(descr[0]);
STARPUFFT(complex) * restrict twisted1 = (STARPUFFT(complex)
*)STARPU_VECTOR_GET_PTR(descr[1]);
- //printf("twist1 %d %d %g\n", i, j, (double) cabs(plan->in[i+j]));
+ /* printf("twist1 %d %d %g\n", i, j, (double) cabs(plan->in[i+j])); */
for (k = 0; k < n2; k++)
for (l = 0; l < m2; l++)
@@ -169,7 +169,7 @@
_fftw_complex * restrict worker_in1 = (STARPUFFT(complex)
*)plan->plans[workerid].in1;
_fftw_complex * restrict worker_out1 = (STARPUFFT(complex)
*)plan->plans[workerid].out1;
- //printf("fft1 %d %d %g\n", i, j, (double) cabs(twisted1[0]));
+ /* printf("fft1 %d %d %g\n", i, j, (double) cabs(twisted1[0])); */
memcpy(worker_in1, twisted1, plan->totsize2 * sizeof(*worker_in1));
_FFTW(execute)(plan->plans[workerid].plan1_cpu);
@@ -198,7 +198,7 @@
STARPUFFT(complex) * restrict twisted2 = (STARPUFFT(complex)
*)STARPU_VECTOR_GET_PTR(descr[0]);
- //printf("twist2 %d %d %g\n", kk, ll, (double)
cabs(plan->fft1[kk+ll]));
+ /* printf("twist2 %d %d %g\n", kk, ll, (double)
cabs(plan->fft1[kk+ll])); */
for (kkk = 0; kkk < n3; kkk++) {
int k = kk * n3 + kkk;
@@ -218,8 +218,8 @@
{
struct STARPUFFT(args) *args = _args;
STARPUFFT(plan) plan = args->plan;
- //int kk = args->kk;
- //int ll = args->ll;
+ /* int kk = args->kk; */
+ /* int ll = args->ll; */
int workerid = starpu_worker_get_id();
task_per_worker[workerid]++;
@@ -227,7 +227,7 @@
const STARPUFFT(complex) *twisted2 = (STARPUFFT(complex)
*)STARPU_VECTOR_GET_PTR(descr[0]);
STARPUFFT(complex) *fft2 = (STARPUFFT(complex)
*)STARPU_VECTOR_GET_PTR(descr[1]);
- //printf("fft2 %d %d %g\n", kk, ll, (double)
cabs(twisted2[plan->totsize4-1]));
+ /* printf("fft2 %d %d %g\n", kk, ll, (double)
cabs(twisted2[plan->totsize4-1])); */
_fftw_complex * restrict worker_in2 = (STARPUFFT(complex)
*)plan->plans[workerid].in2;
_fftw_complex * restrict worker_out2 = (STARPUFFT(complex)
*)plan->plans[workerid].out2;
@@ -259,7 +259,7 @@
const STARPUFFT(complex) * restrict fft2 = (STARPUFFT(complex)
*)STARPU_VECTOR_GET_PTR(descr[0]);
- //printf("twist3 %d %d %g\n", kk, ll, (double) cabs(fft2[0]));
+ /* printf("twist3 %d %d %g\n", kk, ll, (double) cabs(fft2[0])); */
for (kkk = 0; kkk < n3; kkk++) {
int k = kk * n3 + kkk;
@@ -530,7 +530,7 @@
/* Create twist1 task */
plan->twist1_tasks[z] = task = starpu_task_create();
task->cl = &STARPUFFT(twist1_2d_codelet);
- //task->buffers[0].handle = to be filled at execution
+ /* task->buffers[0].handle = to be filled at execution */
task->buffers[0].mode = STARPU_R;
task->buffers[1].handle = plan->twisted1_handle[z];
task->buffers[1].mode = STARPU_W;
Index: examples/basic_examples/block_opencl.c
===================================================================
--- examples/basic_examples/block_opencl.c (revision 3417)
+++ examples/basic_examples/block_opencl.c (working copy)
@@ -25,7 +25,7 @@
cl_kernel kernel;
cl_command_queue queue;
cl_event event;
- int id, devid, err, n;
+ int id, devid, err;
float *block = (float *)STARPU_BLOCK_GET_PTR(descr[0]);
int nx = (int)STARPU_BLOCK_GET_NX(descr[0]);
int ny = (int)STARPU_BLOCK_GET_NY(descr[0]);
@@ -41,7 +41,6 @@
if (err != CL_SUCCESS) STARPU_OPENCL_REPORT_ERROR(err);
err = 0;
- n=0;
err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &block);
err = clSetKernelArg(kernel, 1, sizeof(int), &nx);
err = clSetKernelArg(kernel, 2, sizeof(int), &ny);
Index: examples/spmv/dw_spmv.c
===================================================================
--- examples/spmv/dw_spmv.c (revision 3417)
+++ examples/spmv/dw_spmv.c (working copy)
@@ -127,13 +127,11 @@
uint32_t firstelem = STARPU_CSR_GET_FIRSTENTRY(descr[0]);
- uint32_t nnz;
uint32_t nrow;
- nnz = STARPU_CSR_GET_NNZ(descr[0]);
nrow = STARPU_CSR_GET_NROW(descr[0]);
- //STARPU_ASSERT(nrow == STARPU_VECTOR_GET_NX(descr[1]));
+ /* STARPU_ASSERT(nrow == STARPU_VECTOR_GET_NX(descr[1])); */
STARPU_ASSERT(nrow == STARPU_VECTOR_GET_NX(descr[2]));
unsigned row;
Index: examples/pi/pi_redux.c
===================================================================
--- examples/pi/pi_redux.c (revision 3417)
+++ examples/pi/pi_redux.c (working copy)
@@ -102,11 +102,6 @@
static void pi_func_cpu(void *descr[], void *cl_arg __attribute__ ((unused)))
{
- int workerid = starpu_worker_get_id();
-
- unsigned short *worker_xsub;
- worker_xsub = &xsubi[3*workerid];
-
unsigned long local_cnt = 0;
/* Fill the scratchpad with random numbers */
Index: examples/stencil/Makefile.am
===================================================================
--- examples/stencil/Makefile.am (revision 3417)
+++ examples/stencil/Makefile.am (working copy)
@@ -13,7 +13,7 @@
#
# See the GNU Lesser General Public License in COPYING.LGPL for more details.
-AM_CFLAGS = $(HWLOC_CFLAGS)
+AM_CFLAGS = $(HWLOC_CFLAGS) -std=c89
LIBS = $(top_builddir)/src/libstarpu.la $(HWLOC_LIBS) @LIBS@
AM_CPPFLAGS = -I$(top_srcdir)/include/ -I$(top_srcdir)/examples/
-I$(top_builddir)/include
Index: examples/Makefile.am
===================================================================
--- examples/Makefile.am (revision 3417)
+++ examples/Makefile.am (working copy)
@@ -14,7 +14,7 @@
#
# See the GNU Lesser General Public License in COPYING.LGPL for more details.
-AM_CFLAGS = $(HWLOC_CFLAGS) -Wall
+AM_CFLAGS = $(HWLOC_CFLAGS) -Wall -std=c89
LIBS = $(top_builddir)/src/libstarpu.la $(HWLOC_LIBS) @LIBS@
AM_CPPFLAGS = -I$(top_srcdir)/include/ -I$(top_srcdir)/examples/
-I$(top_builddir)/include
Index: examples/starpufft/Makefile.am
===================================================================
--- examples/starpufft/Makefile.am (revision 3417)
+++ examples/starpufft/Makefile.am (working copy)
@@ -14,7 +14,7 @@
#
# See the GNU Lesser General Public License in COPYING.LGPL for more details.
#
-AM_CPPFLAGS = -I$(top_srcdir)/include/ -I$(top_builddir)/include
+AM_CPPFLAGS = -I$(top_srcdir)/include/ -I$(top_builddir)/include -std=c89
lib_LTLIBRARIES = libstarpufft.la
Index: examples/matvecmult/matvecmult.c
===================================================================
--- examples/matvecmult/matvecmult.c (revision 3417)
+++ examples/matvecmult/matvecmult.c (working copy)
@@ -93,6 +93,10 @@
}
}
+#ifndef __GCC__
+#define sqrtf __builtin_sqrtf
+#endif
+
int compareL2fe(const float* reference, const float* data, const unsigned
int len, const float epsilon) {
float error = 0;
float ref = 0;
@@ -123,8 +127,8 @@
.nopencl = 1,
};
- //int width=1100;
- //int height=244021;
+ /* int width=1100; */
+ /* int height=244021; */
int width=20;
int height=4;
Index: examples/pi/SobolQRNG/sobol_gold.c
===================================================================
--- examples/pi/SobolQRNG/sobol_gold.c (revision 3417)
+++ examples/pi/SobolQRNG/sobol_gold.c (working copy)
@@ -62,7 +62,7 @@
#define k_2powneg32 2.3283064E-10F
-// Create the direction numbers, based on the primitive polynomials.
+/* Create the direction numbers, based on the primitive polynomials. */
void initSobolDirectionVectors(int n_dimensions, unsigned int *directions)
{
unsigned int *v = directions;
@@ -70,40 +70,40 @@
int dim;
for (dim = 0 ; dim < n_dimensions ; dim++)
{
- // First dimension is a special case
+ /* First dimension is a special case */
if (dim == 0)
{
int i;
for (i = 0 ; i < n_directions ; i++)
{
- // All m's are 1
+ /* All m's are 1 */
v[i] = 1 << (31 - i);
}
}
else
{
int d = sobol_primitives[dim].degree;
- // The first direction numbers (up to the degree of the
polynomial)
- // are simply v[i] = m[i] / 2^i (stored in Q0.32 format)
+ /* The first direction numbers (up to the degree of the
polynomial)
+ are simply v[i] = m[i] / 2^i (stored in Q0.32 format) */
int i;
for (i = 0 ; i < d ; i++)
{
v[i] = sobol_primitives[dim].m[i] << (31 - i);
}
- // The remaining direction numbers are computed as described in
- // the Bratley and Fox paper.
- // v[i] = a[1]v[i-1] ^ a[2]v[i-2] ^ ... ^ a[v-1]v[i-d+1] ^
v[i-d] ^ v[i-d]/2^d
+ /* The remaining direction numbers are computed as described in
+ the Bratley and Fox paper.
+ v[i] = a[1]v[i-1] ^ a[2]v[i-2] ^ ... ^ a[v-1]v[i-d+1] ^
v[i-d] ^ v[i-d]/2^d */
for (i = d ; i < n_directions ; i++)
{
- // First do the v[i-d] ^ v[i-d]/2^d part
+ /* First do the v[i-d] ^ v[i-d]/2^d part */
v[i] = v[i - d] ^ (v[i - d] >> d);
- // Now do the a[1]v[i-1] ^ a[2]v[i-2] ^ ... part
- // Note that the coefficients a[] are zero or one and for
compactness in
- // the input tables they are stored as bits of a single
integer. To extract
- // the relevant bit we use right shift and mask with 1.
- // For example, for a 10 degree polynomial there are ten
useful bits in a,
- // so to get a[2] we need to right shift 7 times (to get the
8th bit into
- // the LSB) and then mask with 1.
+ /* Now do the a[1]v[i-1] ^ a[2]v[i-2] ^ ... part
+ Note that the coefficients a[] are zero or one and for
compactness in
+ the input tables they are stored as bits of a single
integer. To extract
+ the relevant bit we use right shift and mask with 1.
+ For example, for a 10 degree polynomial there are ten
useful bits in a,
+ so to get a[2] we need to right shift 7 times (to get the
8th bit into
+ the LSB) and then mask with 1. */
int j;
for (j = 1 ; j < d ; j++)
{
@@ -115,7 +115,7 @@
}
}
-// Reference model for generating Sobol numbers on the host
+/* Reference model for generating Sobol numbers on the host */
void sobolCPU(int n_vectors, int n_dimensions, unsigned int *directions,
float *output)
{
unsigned int *v = directions;
@@ -124,16 +124,16 @@
for (d = 0 ; d < n_dimensions ; d++)
{
unsigned int X = 0;
- // x[0] is zero (in all dimensions)
+ /* x[0] is zero (in all dimensions) */
output[n_vectors * d] = 0.0;
int i;
for (i = 1 ; i < n_vectors ; i++)
{
- // x[i] = x[i-1] ^ v[c]
- // where c is the index of the rightmost zero bit in i
- // minus 1 (since C arrays count from zero)
- // In the Bratley and Fox paper this is equation (**)
- X ^= v[ffs(~(i - 1)) - 1];
+ /* x[i] = x[i-1] ^ v[c]
+ where c is the index of the rightmost zero bit in i
+ minus 1 (since C arrays count from zero)
+ In the Bratley and Fox paper this is equation (**) */
+ X ^= v[__builtin_ffs(~(i - 1)) - 1];
output[i + n_vectors * d] = (float)X * k_2powneg32;
}
v += n_directions;
- [Starpu-devel] Building starpu examples with MSVC, Jonathan Adamczewski, 29/03/2011
- Re: [Starpu-devel] Building starpu examples with MSVC, Cedric Augonnet, 29/03/2011
- Re: [Starpu-devel] Building starpu examples with MSVC, Jonathan Adamczewski, 31/03/2011
- Message indisponible
- Re: [Starpu-devel] Building starpu examples with MSVC, Samuel Thibault, 29/03/2011
- Re: [Starpu-devel] Building starpu examples with MSVC, Cedric Augonnet, 29/03/2011
Archives gérées par MHonArc 2.6.19+.