sa-mustafa commented on issue #17633:
URL: 
https://github.com/apache/incubator-mxnet/issues/17633#issuecomment-751285813


   > I think the function needs to be forward declared or defined in a way that 
the windows compiler sees the symbol, it's not the case now.
   
   The functions are already forward-declared. For example, 
ToTensorImplCUDA/NormalizeImplCUDA/NormalizeBackwardImplCUDA are properly 
declared in 
[image_random-inl.h](https://github.com/apache/incubator-mxnet/blob/8e849e44abf33b5ee19c6631e8f62593cbd669ee/src/operator/image/image_random-inl.h#L52).
   I don't know how the release build succeeds without nagging. Anyway, to work 
around it you should manually instantiate the template functions in the 
corresponding cuda ('.cu') file. For example, add the following lines to 
image_random.cu :
   
   ```c++
   template
   void ToTensorImplCUDA
       <mshadow::bfloat::bf16_t, Tensor<gpu, 3, mshadow::bfloat::bf16_t>, 
Tensor<gpu, 3, float>>
       (mshadow::Stream<gpu>*,
         const Tensor<gpu, 3, mshadow::bfloat::bf16_t>,
         const Tensor<gpu, 3, float>,
         const int, 
         const float);
   
   template
   void ToTensorImplCUDA
       <mshadow::bfloat::bf16_t, Tensor<gpu, 4, mshadow::bfloat::bf16_t>, 
Tensor<gpu, 4, float>>
       (mshadow::Stream<gpu>*,
         const Tensor<gpu, 4, mshadow::bfloat::bf16_t>,
         const Tensor<gpu, 4, float>,
         const int, 
         const float);
   ```
   Do this for other functions too (CheckPvalGPU in np_multinomial_op.cu and 
ResizeImplCUDA in resize.cu, NormalizeImplCUDA/NormalizeBackwardImplCUDA in 
image_random.cu).
   That's all.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to