mxnet icon indicating copy to clipboard operation
mxnet copied to clipboard

mxnet 1.2.1 random_generator.h:154:5: error: there are no arguments to 'CUDA_CALL' that depend on a template parameter, so a declaration of 'CUDA_CALL' must be available [-fpermissive] CUDA_CALL(cudaMalloc(&inst->states_,

Open Kaiser-Yang opened this issue 3 years ago • 2 comments

Description

when compiling mxnet 1.2.1, I found that there are some compilation errors. I think these ERRORs are weird. It is described below.

Error Message

/src/common/random_generator.h:154:5: error: there are no arguments to 'CUDA_CALL' that depend on a template parameter, so a declaration of 'CUDA_CALL' must be available [-fpermissive] CUDA_CALL(cudaMalloc(&inst->states_,

To Reproduce

clone mxnet-1.2.1 from github and set root/make/config.mk USE_CUDA CUDA_PATH USE_DIST_KVSTORE and enter root to start with command make

What have you tried to solve it?

I add the below code into random_generator.h image

Environment

cuda-11.2 ubuntu 16.04

What perplexes me is the CUDA_CALL is define in ../common/cuda_utils.h, and included by random_generator.h but getting a compilation error

Kaiser-Yang avatar Dec 04 '22 07:12 Kaiser-Yang

Welcome to Apache MXNet (incubating)! We are on a mission to democratize AI, and we are glad that you are contributing to it by opening this issue. Please make sure to include all the relevant context, and one of the @apache/mxnet-committers will be here shortly. If you are interested in contributing to our project, let us know! Also, be sure to check out our guide on contributing to MXNet and our development guides wiki.

github-actions[bot] avatar Dec 04 '22 07:12 github-actions[bot]

after adding this code, the problem is solved. So I wonder why this problem occurs even when including cuda_utils.h; CUDA_CALL is defined in cuda_utils.h as below: image

Kaiser-Yang avatar Dec 04 '22 07:12 Kaiser-Yang