You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

initialize_all.cu 5.4 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /***************************************************************************************************
  2. * Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. *modification, are permitted provided that the following conditions are met:
  6. * * Redistributions of source code must retain the above copyright notice,
  7. *this list of conditions and the following disclaimer.
  8. * * Redistributions in binary form must reproduce the above copyright
  9. *notice, this list of conditions and the following disclaimer in the
  10. *documentation and/or other materials provided with the distribution.
  11. * * Neither the name of the NVIDIA CORPORATION nor the names of its
  12. *contributors may be used to endorse or promote products derived from this
  13. *software without specific prior written permission.
  14. *
  15. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  16. *AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  17. *IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  18. *DISCLAIMED. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR ANY DIRECT,
  19. *INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  20. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  21. *DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  22. *OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TOR (INCLUDING
  23. *NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  24. *EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  25. *
  26. **************************************************************************************************/
  27. /**
  28. * \file dnn/src/cuda/cutlass/initialize_all.cpp
  29. * MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
  30. *
  31. * Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
  32. *
  33. * Unless required by applicable law or agreed to in writing,
  34. * software distributed under the License is distributed on an
  35. * "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or
  36. * implied.
  37. */
  38. #include "src/cuda/cutlass/manifest.h"
  39. /////////////////////////////////////////////////////////////////////////////////////////////////
  40. namespace cutlass {
  41. namespace library {
  42. /////////////////////////////////////////////////////////////////////////////////////////////////
  43. #if ((__CUDACC_VER_MAJOR__ > 10) || \
  44. (__CUDACC_VER_MAJOR__ == 10 && __CUDACC_VER_MINOR__ >= 1))
  45. #define CUTLASS_ARCH_MMA_SM70_SUPPORTED 1
  46. #endif
  47. #if ((__CUDACC_VER_MAJOR__ > 10) || \
  48. (__CUDACC_VER_MAJOR__ == 10 && __CUDACC_VER_MINOR__ >= 2))
  49. #define CUTLASS_ARCH_MMA_SM75_SUPPORTED 1
  50. #endif
  51. #if __CUDACC_VER_MAJOR__ > 9 || (__CUDACC_VER_MAJOR__ == 9 && __CUDACC_VER_MINOR__ >= 2)
  52. void initialize_all_gemm_simt_operations(Manifest& manifest);
  53. void initialize_all_conv2d_simt_operations(Manifest& manifest);
  54. void initialize_all_deconv_simt_operations(Manifest& manifest);
  55. void initialize_all_dwconv2d_fprop_simt_operations(Manifest& manifest);
  56. void initialize_all_dwconv2d_dgrad_simt_operations(Manifest& manifest);
  57. void initialize_all_dwconv2d_wgrad_simt_operations(Manifest& manifest);
  58. #if defined(CUTLASS_ARCH_MMA_SM70_SUPPORTED) && CUTLASS_ARCH_MMA_SM70_SUPPORTED
  59. void initialize_all_gemm_tensorop884_operations(Manifest& manifest);
  60. void initialize_all_dwconv2d_fprop_tensorop884_operations(Manifest& manifest);
  61. void initialize_all_dwconv2d_dgrad_tensorop884_operations(Manifest& manifest);
  62. void initialize_all_dwconv2d_wgrad_tensorop884_operations(Manifest& manifest);
  63. #endif
  64. #if defined(CUTLASS_ARCH_MMA_SM75_SUPPORTED) && CUTLASS_ARCH_MMA_SM75_SUPPORTED
  65. void initialize_all_gemm_tensorop1688_operations(Manifest& manifest);
  66. void initialize_all_conv2d_tensorop8816_operations(Manifest& manifest);
  67. void initialize_all_conv2d_tensorop8832_operations(Manifest& manifest);
  68. void initialize_all_deconv_tensorop8816_operations(Manifest& manifest);
  69. #endif
  70. void initialize_all(Manifest& manifest) {
  71. initialize_all_gemm_simt_operations(manifest);
  72. initialize_all_conv2d_simt_operations(manifest);
  73. initialize_all_deconv_simt_operations(manifest);
  74. initialize_all_dwconv2d_fprop_simt_operations(manifest);
  75. initialize_all_dwconv2d_dgrad_simt_operations(manifest);
  76. initialize_all_dwconv2d_wgrad_simt_operations(manifest);
  77. #if defined(CUTLASS_ARCH_MMA_SM70_SUPPORTED) && CUTLASS_ARCH_MMA_SM70_SUPPORTED
  78. initialize_all_gemm_tensorop884_operations(manifest);
  79. initialize_all_dwconv2d_fprop_tensorop884_operations(manifest);
  80. initialize_all_dwconv2d_dgrad_tensorop884_operations(manifest);
  81. initialize_all_dwconv2d_wgrad_tensorop884_operations(manifest);
  82. #endif
  83. #if defined(CUTLASS_ARCH_MMA_SM75_SUPPORTED) && CUTLASS_ARCH_MMA_SM75_SUPPORTED
  84. initialize_all_gemm_tensorop1688_operations(manifest);
  85. initialize_all_conv2d_tensorop8816_operations(manifest);
  86. initialize_all_conv2d_tensorop8832_operations(manifest);
  87. initialize_all_deconv_tensorop8816_operations(manifest);
  88. #endif
  89. }
  90. #else
  91. void initialize_all(Manifest& manifest) {}
  92. #endif
  93. /////////////////////////////////////////////////////////////////////////////////////////////////
  94. } // namespace library
  95. } // namespace cutlass
  96. /////////////////////////////////////////////////////////////////////////////////////////////////