hotspot.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #ifndef HOTSPOT_H
  2. #define HOTSPOT_H
  3. #include "OpenCL_helper_library.h"
  4. #include <CL/cl.h>
  5. #include <stdio.h>
  6. #include <string.h>
  7. #include <stdlib.h>
  8. #include <sys/time.h>
  9. #include <assert.h>
  10. #ifdef RD_WG_SIZE_0_0
  11. #define BLOCK_SIZE RD_WG_SIZE_0_0
  12. #elif defined(RD_WG_SIZE_0)
  13. #define BLOCK_SIZE RD_WG_SIZE_0
  14. #elif defined(RD_WG_SIZE)
  15. #define BLOCK_SIZE RD_WG_SIZE
  16. #else
  17. #define BLOCK_SIZE 8
  18. #endif
  19. #define STR_SIZE 256
  20. # define EXPAND_RATE 2// add one iteration will extend the pyramid base by 2 per each borderline
  21. /* maximum power density possible (say 300W for a 10mm x 10mm chip) */
  22. #define MAX_PD (3.0e6)
  23. /* required precision in degrees */
  24. #define PRECISION 0.001
  25. #define SPEC_HEAT_SI 1.75e6
  26. #define K_SI 100
  27. /* capacitance fitting factor */
  28. #define FACTOR_CHIP 0.5
  29. #define MIN(a, b) ((a)<=(b) ? (a) : (b))
  30. /* chip parameters */
  31. const static float t_chip = 0.0005;
  32. const static float chip_height = 0.016;
  33. const static float chip_width = 0.016;
  34. /* ambient temperature, assuming no package at all */
  35. const static float amb_temp = 80.0;
  36. // OpenCL globals
  37. cl_context context;
  38. cl_command_queue command_queue;
  39. cl_device_id device;
  40. cl_kernel kernel;
  41. void writeoutput(float *, int, int, char *);
  42. void readinput(float *, int, int, char *);
  43. int compute_tran_temp(cl_mem, cl_mem[2], int, int, int, int, int, int, int, int, float *, float *);
  44. void usage(int, char **);
  45. void run(int, char **);
  46. #endif