///****测试在kernel里面交换全局内存的值
#include<iostream>
#include<cuda.h>
#include<cuda_runtime.h>
#include<time.h>
using namespace std;
const int N=300;
__global__ void show(int* a)
{
for(int i=blockIdx.x*blockDim.x+threadIdx.x;i<N+blockDim.x*gridDim.x;
i+=blockDim.x*gridDim.x)
{
if(i<N)
{
printf("%d ",a[i]);
/*a[i]++;*/
if(i%60==0)
printf("\n\n\n");
}
#include<iostream>
#include<cuda.h>
#include<cuda_runtime.h>
#include<time.h>
using namespace std;
const int N=300;
__global__ void show(int* a)
{
for(int i=blockIdx.x*blockDim.x+threadIdx.x;i<N+blockDim.x*gridDim.x;
i+=blockDim.x*gridDim.x)
{
if(i<N)
{
printf("%d ",a[i]);
/*a[i]++;*/
if(i%60==0)
printf("\n\n\n");
}