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

23 lines
775 B

7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #include "cuda.h"
  2. #include "../layers/avgpoolLayer.h"
  3. void gpuCUDA::pull_layer(avgpoolLayer *layer){
  4. if (layer->m_pOutput != NULL && layer->m_pDelta != NULL){
  5. if (layer->m_pGpuOutput != NULL){
  6. pullFloatArray(layer->m_pGpuOutput, layer->m_pOutput, layer->m_nOutputVol);
  7. };
  8. if (layer->m_pGpuDelta != NULL){
  9. pullFloatArray(layer->m_pGpuDelta, layer->m_pDelta, layer->m_nDeltaVol);
  10. };
  11. };
  12. };
  13. void gpuCUDA::push_layer(avgpoolLayer *layer){
  14. if (layer->m_pOutput != NULL && layer->m_pDelta != NULL){
  15. if (layer->m_pGpuOutput != NULL){
  16. pushFloatArray(layer->m_pGpuOutput, layer->m_pOutput, layer->m_nOutputVol);
  17. };
  18. if (layer->m_pGpuDelta != NULL){
  19. pushFloatArray(layer->m_pGpuDelta, layer->m_pDelta, layer->m_nDeltaVol);
  20. };
  21. };
  22. };