如何在Google Colab中将标志传递给NVCC? [英] How to pass flags to nvcc in google colab?

查看:99
本文介绍了如何在Google Colab中将标志传递给NVCC?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 __ device __ lambda,但它表示我需要传递'--expt-extended-lambda'标志.

I want to use __device__ lambda but it said that I need to pass the flag '--expt-extended-lambda'.

我在colab中使用此环境.

I use this environment in colab.

!wget https://developer.nvidia.com/compute/cuda/9.2/Prod/local_installers/cuda-repo-ubuntu1604-9-2- 
local_9.2.88-1_amd64 -O cuda-repo-ubuntu1604-9-2-local_9.2.88-1_amd64.deb
!dpkg -i cuda-repo-ubuntu1604-9-2-local_9.2.88-1_amd64.deb
!apt-key add /var/cuda-repo-9-2-local/7fa2af80.pub
!apt-get update
!apt-get install cuda-9.2
!nvcc --version

!pip install git+git://github.com/andreinechaev/nvcc4jupyter.git
%load_ext nvcc_plugin

我写这样的代码

%%cu
int main() {}

我不知道要通过国旗.

推荐答案

我对相关代码提示您不能这样做.似乎不支持通过该插件将其他参数传递给nvcc.

My reading of the relevant code suggests that you can't. There appears to be no support for passing additional arguments to nvcc via that plugin.

如果您不知道如何做,则需要对插件进行分叉和修改,以品尝或请插件的作者进行相同的操作.

You would need to fork and modify the plugin to taste or petition the authors of the plugin to do the same if you don't understand how to do this.

或者,使用此hack ,它会强制插件写入文件,然后通过运行手动编译该文件nvcc自己.

Alternatively, use this hack, which forces the plugin to write to a file and then hand compile that file by running nvcc yourself.

这篇关于如何在Google Colab中将标志传递给NVCC?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆