- 博客(7)
- 收藏
- 关注
原创 CUDA实验:数组相加
本文主要实现向量相加的cuda编程。 首先写出整体框架:#include "error.cuh"#include <stdio.h>#include <cuda_runtime.h>#define N (33 * 1024)__global__ void add( int *a, int *b, int *c ) {// 此处为待填充区域}int main( void ) { //定义主机指针和设备指针 int *a, *b,...
2022-04-30 16:30:35
678
转载 更改 jupyter 工作目录&将虚拟环境添加到 jupyter 中
一: 更改jupyter 工作目录1,在cmd 中输入以下命令,生成配置文件jupyter notebook --generate-config2,在以下路径中找到配置文件,一般是C盘用户目录下的。~/.jupyter/jupyter_notebook_config.py3,找到 notebook_dir 做以下更改c.NotebookApp.notebook_dir = ‘更改后的文件路径’并删除前面的# 号4,找到jupyter快捷方式,属性打开删掉目标中的%USERPROFIL
2021-10-17 16:36:44
540
1
原创 anaconda下Pytorch的安装
文章目录anaconda下Pytorch的安装检查是否已经安装CUDA安装Pytorch查看安装命令创建新环境安装pytorchanaconda下Pytorch的安装检查是否已经安装CUDA安装gpu pytorch是不需要自己手动安装cuda和cudnn,小编当时找了很多教程都是先安装CUDA再安装CUDNN最后安装pytorch,整了好久也没看明白,网友评论真是给我当头一棒。果真,大部分电脑应该已经有CUDA了,所以不用提前安装,大家一定要先看看自己有没有在安装哦。win+R打开cmd界面输入
2021-10-17 16:24:44
285
原创 去重排序
#include<stdio.h>int main(){ int a[100],b[100]; int i=0,j,k,r,q,p; int n = 0;scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d",&a[i]); } for(j=0;j<n-1;j++) { for(r=j+1;r>0;r--) { if(a[r]>a[r-1]) { q=a[r];a[
2020-07-26 20:45:58
115
原创 输入一组数组,回车结束的方法
1 while(scanf("%d",&b))2 {3 array[i++] = b;4 if ('\n' == getchar())5 {6 array[i] = '\0';7 break;8 }9 }#include<stdio.h>int main(){int a[10];int n = 0, i;char ch...
2020-07-08 03:09:53
9394
1
转载 将输入的字符串逆序输出 进一步了解printf
【问题描述】将输入的字符串逆序输出【输入形式】要求输入一个字符串【输出形式】逆序后输出方法一:#include<stdio.h>#include<string.h>int main(){char a[100],b[100];int i,n;scanf("%s",a);n=strlen(a);for(i=n-1;i>=0;i–){putchar(a[i]);}}方法二#include<stdio.h>#include<str
2020-07-07 11:18:51
536
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人