[Linux][2012-08-28] c/cpp # 井号 双井号 的使用

本文详细介绍了C/C++宏定义中单井号(#)与双井号(##)的作用及使用方法。单井号(#)可以将参数转换为字符串,而双井号(##)则用于连接两个子串形成新的标识符。
在宏定义中经常会用到#和##
单井号(#)
把传递过来的参数当成字符串进行替代
如下示例:
#define display(name) printf(""#name"")
int main() {
  display(name);
}


输出:
name

说明:# 不可以 是第一个和最后一个, 所以 前后使用“”。



双井号(##)
称为连接符
在带参数的宏定义中将两个子串(token)联接起来,从而形成一个新的子串(变量或类型)。但它不可以是第一个或者最后一个子串。所谓的子串(token)就是指编译器能够识别的最小语法单元。具体的定义在参考编译原理。

下面是MSDN上的一个例子。
假设程序中已经定义了这样一个带参数的宏:

#define paster( n ) printf( "token" #n " = %d", token##n )
//同时又定义了一个整形变量:
int token9 = 9;


现在在主程序中以下面的方式调用这个宏:
paster( 9 );

那么在编译时,上面的这句话被扩展为:
printf( "token" "9" " = %d", token9 );

注意到在这个例子中,paster(9);中的这个”9”被原封不动的当成了一个字符串,与”token”连接在了一起,从而成为了token9。而#n也被”9”所替代。

可想而知,上面程序运行的结果就是在屏幕上打印出token9=9

原文转自:http://www.delnabla.cn/article.asp?id=205

参考:http://thatax.blog.163.com/blog/static/20892680200882391827116/

copying mmcv/ops/csrc/parrots/min_area_polygons_pytorch.h -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/modulated_deform_conv.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/modulated_deform_conv_parrots.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/modulated_deform_conv_pytorch.h -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/ms_deform_attn.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/ms_deform_attn_parrots.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/nms.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/nms_parrots.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/nms_pytorch.h -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/nms_rotated.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/pixel_group.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/pixel_group_parrots.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/pixel_group_pytorch.h -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/points_in_boxes.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/points_in_boxes_parrots.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/points_in_boxes_pytorch.h -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/points_in_polygons.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/points_in_polygons_parrots.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/points_in_polygons_pytorch.h -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/psamask.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/psamask_parrots.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/psamask_pytorch.h -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/riroi_align_rotated.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/riroi_align_rotated_parrots.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/riroi_align_rotated_pytorch.h -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/roi_align.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/roi_align_parrots.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/roi_align_pytorch.h -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/roi_align_rotated.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/roi_align_rotated_parrots.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/roi_align_rotated_pytorch.h -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/roi_pool.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/roi_pool_parrots.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/roi_pool_pytorch.h -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/roiaware_pool3d.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/roiaware_pool3d_parrots.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/roiaware_pool3d_pytorch.h -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/roipoint_pool3d.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/roipoint_pool3d_parrots.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/roipoint_pool3d_pytorch.h -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/rotated_feature_align.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/rotated_feature_align_parrots.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/rotated_feature_align_pytorch.h -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/sync_bn.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/sync_bn_parrots.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/sync_bn_pytorch.h -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/three_interpolate.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/three_interpolate_parrots.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/three_interpolate_pytorch.h -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/three_nn.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/three_nn_parrots.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/three_nn_pytorch.h -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/tin_shift.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/tin_shift_parrots.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/tin_shift_pytorch.h -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/upfirdn2d.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/upfirdn2d_parrots.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/voxelization.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/voxelization_parrots.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots copying mmcv/ops/csrc/parrots/voxelization_pytorch.h -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/parrots creating build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch copying mmcv/ops/csrc/pytorch/active_rotated_filter.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch copying mmcv/ops/csrc/pytorch/assign_score_withk.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch copying mmcv/ops/csrc/pytorch/ball_query.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch copying mmcv/ops/csrc/pytorch/bbox_overlaps.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch copying mmcv/ops/csrc/pytorch/border_align.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch copying mmcv/ops/csrc/pytorch/box_iou_rotated.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch copying mmcv/ops/csrc/pytorch/carafe.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch copying mmcv/ops/csrc/pytorch/carafe_naive.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch copying mmcv/ops/csrc/pytorch/contour_expand.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch copying mmcv/ops/csrc/pytorch/convex_iou.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch copying mmcv/ops/csrc/pytorch/correlation.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch copying mmcv/ops/csrc/pytorch/deform_conv.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch copying mmcv/ops/csrc/pytorch/deform_roi_pool.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch copying mmcv/ops/csrc/pytorch/diff_iou_rotated.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch copying mmcv/ops/csrc/pytorch/focal_loss.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch copying mmcv/ops/csrc/pytorch/furthest_point_sample.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch copying mmcv/ops/csrc/pytorch/fused_bias_leakyrelu.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch copying mmcv/ops/csrc/pytorch/fused_spconv_ops.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch copying mmcv/ops/csrc/pytorch/gather_points.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch copying mmcv/ops/csrc/pytorch/group_points.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch copying mmcv/ops/csrc/pytorch/info.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch copying mmcv/ops/csrc/pytorch/iou3d.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch copying mmcv/ops/csrc/pytorch/knn.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch copying mmcv/ops/csrc/pytorch/masked_conv2d.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch copying mmcv/ops/csrc/pytorch/min_area_polygons.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch copying mmcv/ops/csrc/pytorch/modulated_deform_conv.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch copying mmcv/ops/csrc/pytorch/ms_deform_attn.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch copying mmcv/ops/csrc/pytorch/nms.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch copying mmcv/ops/csrc/pytorch/nms_rotated.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch copying mmcv/ops/csrc/pytorch/pixel_group.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch copying mmcv/ops/csrc/pytorch/points_in_boxes.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch copying mmcv/ops/csrc/pytorch/points_in_polygons.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch copying mmcv/ops/csrc/pytorch/psamask.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch copying mmcv/ops/csrc/pytorch/pybind.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch copying mmcv/ops/csrc/pytorch/riroi_align_rotated.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch copying mmcv/ops/csrc/pytorch/roi_align.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch copying mmcv/ops/csrc/pytorch/roi_align_rotated.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch copying mmcv/ops/csrc/pytorch/roi_pool.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch copying mmcv/ops/csrc/pytorch/roiaware_pool3d.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch copying mmcv/ops/csrc/pytorch/roipoint_pool3d.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch copying mmcv/ops/csrc/pytorch/rotated_feature_align.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch copying mmcv/ops/csrc/pytorch/scatter_points.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch copying mmcv/ops/csrc/pytorch/sparse_pool_ops.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch copying mmcv/ops/csrc/pytorch/spconv_ops.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch copying mmcv/ops/csrc/pytorch/spconv_utils.h -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch copying mmcv/ops/csrc/pytorch/sync_bn.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch copying mmcv/ops/csrc/pytorch/three_interpolate.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch copying mmcv/ops/csrc/pytorch/three_nn.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch copying mmcv/ops/csrc/pytorch/tin_shift.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch copying mmcv/ops/csrc/pytorch/upfirdn2d.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch copying mmcv/ops/csrc/pytorch/voxelization.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch creating build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cpu copying mmcv/ops/csrc/pytorch/cpu/active_rotated_filter.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cpu copying mmcv/ops/csrc/pytorch/cpu/box_iou_rotated.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cpu copying mmcv/ops/csrc/pytorch/cpu/deform_conv.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cpu copying mmcv/ops/csrc/pytorch/cpu/modulated_deform_conv.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cpu copying mmcv/ops/csrc/pytorch/cpu/nms.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cpu copying mmcv/ops/csrc/pytorch/cpu/nms_rotated.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cpu copying mmcv/ops/csrc/pytorch/cpu/pixel_group.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cpu copying mmcv/ops/csrc/pytorch/cpu/points_in_boxes.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cpu copying mmcv/ops/csrc/pytorch/cpu/psamask.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cpu copying mmcv/ops/csrc/pytorch/cpu/roi_align.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cpu copying mmcv/ops/csrc/pytorch/cpu/roi_align_rotated.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cpu copying mmcv/ops/csrc/pytorch/cpu/sparse_indice.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cpu copying mmcv/ops/csrc/pytorch/cpu/sparse_maxpool.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cpu copying mmcv/ops/csrc/pytorch/cpu/sparse_reordering.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cpu copying mmcv/ops/csrc/pytorch/cpu/voxelization.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cpu creating build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda copying mmcv/ops/csrc/pytorch/cuda/active_rotated_filter_cuda.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda copying mmcv/ops/csrc/pytorch/cuda/assign_score_withk_cuda.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda copying mmcv/ops/csrc/pytorch/cuda/ball_query_cuda.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda copying mmcv/ops/csrc/pytorch/cuda/bbox_overlaps_cuda.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda copying mmcv/ops/csrc/pytorch/cuda/border_align_cuda.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda copying mmcv/ops/csrc/pytorch/cuda/box_iou_rotated_cuda.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda copying mmcv/ops/csrc/pytorch/cuda/carafe_cuda.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda copying mmcv/ops/csrc/pytorch/cuda/carafe_naive_cuda.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda copying mmcv/ops/csrc/pytorch/cuda/convex_iou.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda copying mmcv/ops/csrc/pytorch/cuda/correlation_cuda.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda copying mmcv/ops/csrc/pytorch/cuda/cudabind.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda copying mmcv/ops/csrc/pytorch/cuda/deform_conv_cuda.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda copying mmcv/ops/csrc/pytorch/cuda/deform_roi_pool_cuda.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda copying mmcv/ops/csrc/pytorch/cuda/diff_iou_rotated_cuda.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda copying mmcv/ops/csrc/pytorch/cuda/focal_loss_cuda.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda copying mmcv/ops/csrc/pytorch/cuda/furthest_point_sample_cuda.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda copying mmcv/ops/csrc/pytorch/cuda/fused_bias_leakyrelu_cuda.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda copying mmcv/ops/csrc/pytorch/cuda/fused_spconv_ops_cuda.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda copying mmcv/ops/csrc/pytorch/cuda/gather_points_cuda.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda copying mmcv/ops/csrc/pytorch/cuda/group_points_cuda.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda copying mmcv/ops/csrc/pytorch/cuda/iou3d_cuda.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda copying mmcv/ops/csrc/pytorch/cuda/knn_cuda.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda copying mmcv/ops/csrc/pytorch/cuda/masked_conv2d_cuda.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda copying mmcv/ops/csrc/pytorch/cuda/min_area_polygons.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda copying mmcv/ops/csrc/pytorch/cuda/modulated_deform_conv_cuda.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda copying mmcv/ops/csrc/pytorch/cuda/ms_deform_attn_cuda.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda copying mmcv/ops/csrc/pytorch/cuda/nms_cuda.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda copying mmcv/ops/csrc/pytorch/cuda/nms_rotated_cuda.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda copying mmcv/ops/csrc/pytorch/cuda/points_in_boxes_cuda.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda copying mmcv/ops/csrc/pytorch/cuda/points_in_polygons_cuda.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda copying mmcv/ops/csrc/pytorch/cuda/psamask_cuda.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda copying mmcv/ops/csrc/pytorch/cuda/riroi_align_rotated_cuda.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda copying mmcv/ops/csrc/pytorch/cuda/roi_align_cuda.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda copying mmcv/ops/csrc/pytorch/cuda/roi_align_rotated_cuda.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda copying mmcv/ops/csrc/pytorch/cuda/roi_pool_cuda.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda copying mmcv/ops/csrc/pytorch/cuda/roiaware_pool3d_cuda.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda copying mmcv/ops/csrc/pytorch/cuda/roipoint_pool3d_cuda.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda copying mmcv/ops/csrc/pytorch/cuda/rotated_feature_align_cuda.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda copying mmcv/ops/csrc/pytorch/cuda/scatter_points_cuda.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda copying mmcv/ops/csrc/pytorch/cuda/sparse_indice.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda copying mmcv/ops/csrc/pytorch/cuda/sparse_maxpool.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda copying mmcv/ops/csrc/pytorch/cuda/sparse_pool_ops_cuda.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda copying mmcv/ops/csrc/pytorch/cuda/sparse_reordering.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda copying mmcv/ops/csrc/pytorch/cuda/spconv_ops_cuda.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda copying mmcv/ops/csrc/pytorch/cuda/sync_bn_cuda.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda copying mmcv/ops/csrc/pytorch/cuda/three_interpolate_cuda.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda copying mmcv/ops/csrc/pytorch/cuda/three_nn_cuda.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda copying mmcv/ops/csrc/pytorch/cuda/tin_shift_cuda.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda copying mmcv/ops/csrc/pytorch/cuda/upfirdn2d_kernel.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda copying mmcv/ops/csrc/pytorch/cuda/voxelization_cuda.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda creating build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/mlu copying mmcv/ops/csrc/pytorch/mlu/bbox_overlaps_mlu.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/mlu copying mmcv/ops/csrc/pytorch/mlu/focal_loss_sigmoid_mlu.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/mlu copying mmcv/ops/csrc/pytorch/mlu/nms_mlu.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/mlu copying mmcv/ops/csrc/pytorch/mlu/roi_align_mlu.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/mlu copying mmcv/ops/csrc/pytorch/mlu/tin_shift_mlu.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/mlu creating build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/tensorrt copying mmcv/ops/csrc/tensorrt/trt_corner_pool.hpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/tensorrt copying mmcv/ops/csrc/tensorrt/trt_cuda_helper.cuh -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/tensorrt copying mmcv/ops/csrc/tensorrt/trt_cummaxmin.hpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/tensorrt copying mmcv/ops/csrc/tensorrt/trt_deform_conv.hpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/tensorrt copying mmcv/ops/csrc/tensorrt/trt_grid_sampler.hpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/tensorrt copying mmcv/ops/csrc/tensorrt/trt_instance_norm.hpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/tensorrt copying mmcv/ops/csrc/tensorrt/trt_modulated_deform_conv.hpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/tensorrt copying mmcv/ops/csrc/tensorrt/trt_nms.hpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/tensorrt copying mmcv/ops/csrc/tensorrt/trt_plugin.hpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/tensorrt copying mmcv/ops/csrc/tensorrt/trt_plugin_helper.hpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/tensorrt copying mmcv/ops/csrc/tensorrt/trt_roi_align.hpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/tensorrt copying mmcv/ops/csrc/tensorrt/trt_scatternd.hpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/tensorrt copying mmcv/ops/csrc/tensorrt/trt_serialize.hpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/tensorrt creating build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/tensorrt/plugins copying mmcv/ops/csrc/tensorrt/plugins/trt_corner_pool.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/tensorrt/plugins copying mmcv/ops/csrc/tensorrt/plugins/trt_corner_pool_kernel.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/tensorrt/plugins copying mmcv/ops/csrc/tensorrt/plugins/trt_cuda_helper.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/tensorrt/plugins copying mmcv/ops/csrc/tensorrt/plugins/trt_cummaxmin.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/tensorrt/plugins copying mmcv/ops/csrc/tensorrt/plugins/trt_cummaxmin_kernel.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/tensorrt/plugins copying mmcv/ops/csrc/tensorrt/plugins/trt_deform_conv.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/tensorrt/plugins copying mmcv/ops/csrc/tensorrt/plugins/trt_deform_conv_kernel.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/tensorrt/plugins copying mmcv/ops/csrc/tensorrt/plugins/trt_grid_sampler.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/tensorrt/plugins copying mmcv/ops/csrc/tensorrt/plugins/trt_grid_sampler_kernel.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/tensorrt/plugins copying mmcv/ops/csrc/tensorrt/plugins/trt_instance_norm.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/tensorrt/plugins copying mmcv/ops/csrc/tensorrt/plugins/trt_modulated_deform_conv.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/tensorrt/plugins copying mmcv/ops/csrc/tensorrt/plugins/trt_modulated_deform_conv_kernel.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/tensorrt/plugins copying mmcv/ops/csrc/tensorrt/plugins/trt_nms.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/tensorrt/plugins copying mmcv/ops/csrc/tensorrt/plugins/trt_nms_kernel.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/tensorrt/plugins copying mmcv/ops/csrc/tensorrt/plugins/trt_plugin.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/tensorrt/plugins copying mmcv/ops/csrc/tensorrt/plugins/trt_roi_align.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/tensorrt/plugins copying mmcv/ops/csrc/tensorrt/plugins/trt_roi_align_kernel.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/tensorrt/plugins copying mmcv/ops/csrc/tensorrt/plugins/trt_scatternd.cpp -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/tensorrt/plugins copying mmcv/ops/csrc/tensorrt/plugins/trt_scatternd_kernel.cu -> build/lib.linux-x86_64-cpython-310/mmcv/ops/csrc/tensorrt/plugins running build_ext Traceback (most recent call last): File "<string>", line 2, in <module> File "<pip-setuptools-caller>", line 35, in <module> File "/tmp/pip-install-llwa_afu/mmcv-full_ee0517bc5c5749f89f22f446bfc7022a/setup.py", line 393, in <module> setup( File "/home/tj/miniconda3/envs/hamer/lib/python3.10/site-packages/setuptools/__init__.py", line 117, in setup return distutils.core.setup(**attrs) File "/home/tj/miniconda3/envs/hamer/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 186, in setup return run_commands(dist) File "/home/tj/miniconda3/envs/hamer/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 202, in run_commands dist.run_commands() File "/home/tj/miniconda3/envs/hamer/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 1002, in run_commands self.run_command(cmd) File "/home/tj/miniconda3/envs/hamer/lib/python3.10/site-packages/setuptools/dist.py", line 1104, in run_command super().run_command(command) File "/home/tj/miniconda3/envs/hamer/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 1021, in run_command cmd_obj.run() File "/home/tj/miniconda3/envs/hamer/lib/python3.10/site-packages/setuptools/command/bdist_wheel.py", line 370, in run self.run_command("build") File "/home/tj/miniconda3/envs/hamer/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 357, in run_command self.distribution.run_command(command) File "/home/tj/miniconda3/envs/hamer/lib/python3.10/site-packages/setuptools/dist.py", line 1104, in run_command super().run_command(command) File "/home/tj/miniconda3/envs/hamer/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 1021, in run_command cmd_obj.run() File "/home/tj/miniconda3/envs/hamer/lib/python3.10/site-packages/setuptools/_distutils/command/build.py", line 135, in run self.run_command(cmd_name) File "/home/tj/miniconda3/envs/hamer/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 357, in run_command self.distribution.run_command(command) File "/home/tj/miniconda3/envs/hamer/lib/python3.10/site-packages/setuptools/dist.py", line 1104, in run_command super().run_command(command) File "/home/tj/miniconda3/envs/hamer/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 1021, in run_command cmd_obj.run() File "/home/tj/miniconda3/envs/hamer/lib/python3.10/site-packages/setuptools/command/build_ext.py", line 99, in run _build_ext.run(self) File "/home/tj/miniconda3/envs/hamer/lib/python3.10/site-packages/setuptools/_distutils/command/build_ext.py", line 368, in run self.build_extensions() File "/home/tj/miniconda3/envs/hamer/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 650, in build_extensions _check_cuda_version(compiler_name, compiler_version) File "/home/tj/miniconda3/envs/hamer/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 506, in _check_cuda_version raise RuntimeError(CUDA_MISMATCH_MESSAGE, cuda_str_version, torch.version.cuda) RuntimeError: (&#39;The detected CUDA version (%s) mismatches the version that was used to compilePyTorch (%s). Please make sure to use the same CUDA versions.&#39;, &#39;11.7&#39;, &#39;12.8&#39;) [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for mmcv-full Running setup.py clean for mmcv-full Failed to build mmcv-full error: failed-wheel-build-for-install × Failed to build installable wheels for some pyproject.toml based projects ╰─> mmcv-full
最新发布
10-06
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值