cl_getplatforminfo.c 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2010-2020 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
  4. * Copyright (C) 2012 Vincent Danjean
  5. *
  6. * StarPU is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU Lesser General Public License as published by
  8. * the Free Software Foundation; either version 2.1 of the License, or (at
  9. * your option) any later version.
  10. *
  11. * StarPU is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  14. *
  15. * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  16. */
  17. #include "socl.h"
  18. #include "getinfo.h"
  19. /**
  20. * \brief Get information about StarPU platform
  21. *
  22. * \param[in] platform StarPU platform ID or NULL
  23. */
  24. CL_API_SUFFIX__VERSION_1_0
  25. CL_API_ENTRY cl_int CL_API_CALL
  26. soclGetPlatformInfo(cl_platform_id platform,
  27. cl_platform_info param_name,
  28. size_t param_value_size,
  29. void * param_value,
  30. size_t * param_value_size_ret)
  31. {
  32. if (platform != NULL && platform != &socl_platform)
  33. return CL_INVALID_PLATFORM;
  34. switch (param_name)
  35. {
  36. INFO_CASE_STRING(CL_PLATFORM_PROFILE, SOCL_PROFILE);
  37. INFO_CASE_STRING(CL_PLATFORM_VERSION, SOCL_VERSION);
  38. INFO_CASE_STRING(CL_PLATFORM_NAME, SOCL_PLATFORM_NAME);
  39. INFO_CASE_STRING(CL_PLATFORM_VENDOR, SOCL_VENDOR);
  40. INFO_CASE_STRING(CL_PLATFORM_EXTENSIONS, SOCL_PLATFORM_EXTENSIONS);
  41. INFO_CASE_STRING(CL_PLATFORM_ICD_SUFFIX_KHR, SOCL_PLATFORM_ICD_SUFFIX_KHR);
  42. default:
  43. return CL_INVALID_VALUE;
  44. }
  45. return CL_SUCCESS;
  46. }