avx512.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // ======================================================================== //
  2. // Copyright 2009-2017 Intel Corporation //
  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. #pragma once
  17. #include "../sys/platform.h"
  18. #include "../sys/intrinsics.h"
  19. #include "../math/constants.h"
  20. #include "varying.h"
  21. #include "vboolf16_avx512.h"
  22. #include "vint16_avx512.h"
  23. #include "vfloat16_avx512.h"
  24. #include "vuint16_avx512.h"
  25. #include "vboold8_avx512.h"
  26. #include "vllong8_avx512.h"
  27. #include "vdouble8_avx512.h"
  28. namespace embree
  29. {
  30. ////////////////////////////////////////////////////////////////////////////////
  31. /// Prefetching
  32. ////////////////////////////////////////////////////////////////////////////////
  33. #define PFHINT_L1 0
  34. #define PFHINT_L2 1
  35. #define PFHINT_NT 2
  36. template<const unsigned int mode>
  37. __forceinline void prefetch(const void * __restrict__ const m)
  38. {
  39. if (mode == PFHINT_L1)
  40. _mm_prefetch((const char*)m,_MM_HINT_T0);
  41. else if (mode == PFHINT_L2)
  42. _mm_prefetch((const char*)m,_MM_HINT_T1);
  43. else if (mode == PFHINT_NT)
  44. _mm_prefetch((const char*)m,_MM_HINT_NTA);
  45. }
  46. }