heat.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2008-2021 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
  4. *
  5. * StarPU is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU Lesser General Public License as published by
  7. * the Free Software Foundation; either version 2.1 of the License, or (at
  8. * your option) any later version.
  9. *
  10. * StarPU is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. *
  14. * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  15. */
  16. #ifndef __HEAT_H__
  17. #define __HEAT_H__
  18. #include <stdio.h>
  19. #include <stdlib.h>
  20. #include <string.h>
  21. #include <assert.h>
  22. #include <math.h>
  23. /* needed for STARPU_OPENGL_RENDER */
  24. #include <starpu.h>
  25. #include <common/blas.h>
  26. #ifdef STARPU_OPENGL_RENDER
  27. #include <GL/gl.h>
  28. #include <GL/glu.h>
  29. #include <GL/glut.h>
  30. #endif
  31. #define FPRINTF(ofile, fmt, ...) do { if (!getenv("STARPU_SSILENT")) {fprintf(ofile, fmt, ## __VA_ARGS__); }} while(0)
  32. #define PRINTF(fmt, ...) do { if (!getenv("STARPU_SSILENT")) {printf(fmt, ## __VA_ARGS__); }} while(0)
  33. #define X 0
  34. #define Y 1
  35. #define DIM ntheta*nthick
  36. #define RMIN (150.0f)
  37. #define RMAX (200.0f)
  38. #define Pi (3.141592f)
  39. #define NODE_NUMBER(theta, thick) ((unsigned long)((thick)+(theta)*nthick))
  40. #define NODE_TO_THICK(n) ((n) % nthick)
  41. #define NODE_TO_THETA(n) ((n) / nthick)
  42. typedef struct point_t
  43. {
  44. float x;
  45. float y;
  46. } point;
  47. extern void dw_factoLU(float *matA, unsigned size, unsigned ld, unsigned nblocks, unsigned version, unsigned no_prio);
  48. extern void dw_factoLU_tag(float *matA, unsigned size, unsigned ld, unsigned nblocks, unsigned no_prio);
  49. extern void dw_factoLU_grain(float *matA, unsigned size, unsigned ld, unsigned nblocks, unsigned nbigblocks);
  50. extern void initialize_system(float **A, float **B, unsigned dim, unsigned pinned);
  51. extern void free_system(float *A, float *B, unsigned dim, unsigned pinned);
  52. void display_stat_heat(void);
  53. #ifdef STARPU_OPENGL_RENDER
  54. extern void opengl_render(unsigned _ntheta, unsigned _nthick, float *_result, point *_pmesh, int argc_, char **argv_);
  55. #endif
  56. #endif /* __HEAT_H__ */