cl_getextensionfunctionaddress.c 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2011-2012 Inria
  4. * Copyright (C) 2012,2017 CNRS
  5. * Copyright (C) 2010-2012, 2018 Université de Bordeaux
  6. * Copyright (C) 2012 Vincent Danjean
  7. *
  8. * StarPU is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU Lesser General Public License as published by
  10. * the Free Software Foundation; either version 2.1 of the License, or (at
  11. * your option) any later version.
  12. *
  13. * StarPU is distributed in the hope that it will be useful, but
  14. * WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  16. *
  17. * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  18. */
  19. #include <string.h>
  20. #include "socl.h"
  21. #include "init.h"
  22. CL_API_SUFFIX__VERSION_1_0
  23. CL_API_ENTRY void * CL_API_CALL
  24. soclGetExtensionFunctionAddress(const char * func_name)
  25. {
  26. if (func_name != NULL && strcmp(func_name, "clShutdown") == 0)
  27. {
  28. return (void*)soclShutdown;
  29. }
  30. return NULL;
  31. }
  32. CL_API_ENTRY void * CL_API_CALL
  33. soclGetExtensionFunctionAddressForPlatform(cl_platform_id p, const char * func_name) CL_API_SUFFIX__VERSION_1_2
  34. {
  35. if (p != &socl_platform)
  36. return NULL;
  37. return soclGetExtensionFunctionAddress(func_name);
  38. }
  39. CL_API_ENTRY void * CL_API_CALL clGetExtensionFunctionAddress(const char * func_name) CL_API_SUFFIX__VERSION_1_0
  40. {
  41. if( func_name != NULL && strcmp("clIcdGetPlatformIDsKHR", func_name) == 0 )
  42. return (void *)soclIcdGetPlatformIDsKHR;
  43. return NULL;
  44. }