kernel_split.cpp 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * Copyright 2011-2013 Blender Foundation
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. /* CPU kernel entry points */
  17. /* On x86-64, we can assume SSE2, so avoid the extra kernel and compile this
  18. * one with SSE2 intrinsics.
  19. */
  20. #if defined(__x86_64__) || defined(_M_X64)
  21. # define __KERNEL_SSE2__
  22. #endif
  23. #define __SPLIT_KERNEL__
  24. /* When building kernel for native machine detect kernel features from the flags
  25. * set by compiler.
  26. */
  27. #ifdef WITH_KERNEL_NATIVE
  28. # ifdef __SSE2__
  29. # ifndef __KERNEL_SSE2__
  30. # define __KERNEL_SSE2__
  31. # endif
  32. # endif
  33. # ifdef __SSE3__
  34. # define __KERNEL_SSE3__
  35. # endif
  36. # ifdef __SSSE3__
  37. # define __KERNEL_SSSE3__
  38. # endif
  39. # ifdef __SSE4_1__
  40. # define __KERNEL_SSE41__
  41. # endif
  42. # ifdef __AVX__
  43. # define __KERNEL_AVX__
  44. # endif
  45. # ifdef __AVX2__
  46. # define __KERNEL_SSE__
  47. # define __KERNEL_AVX2__
  48. # endif
  49. #endif
  50. /* quiet unused define warnings */
  51. #if defined(__KERNEL_SSE2__)
  52. /* do nothing */
  53. #endif
  54. #include "kernel/kernel.h"
  55. #define KERNEL_ARCH cpu
  56. #include "kernel/kernels/cpu/kernel_cpu_impl.h"