Advisory: Cannot tell what pointer points to, assuming global memory space
来源:互联网 发布:50个摄像头网络结构 编辑:程序博客网 时间:2024/06/05 18:29
typedef struct g_states_t
...{
int i;
struct g_states_t *pnext;
}g_state;
typedef struct ST
...{
g_states_t **cur;
g_states_t *ctx[4];
}ST;
void setstates(ST *ps, g_states_t states[4])
...{
for (int i = 0; i < 4 ; i++)
...{
ps->ctx[i] = &states[i];
}
}
void main(int argc, char * argv[])
...{
g_states_t states[4] =
...{
...{400, &states[1]},
...{401, &states[2]},
...{402, &states[3]},
...{403, &states[0]}
};
ST s1, *ps1;
ps1 = &s1;
setstates(ps1, states);
ps1->ctx[2]->i = 123;
ps1->ctx[2]->pnext = &states[0];
ps1->ctx[3]->pnext->i = 456;
printf("%d ", ps1->ctx[2]->i);//ok,output:123
printf("%d ", ps1->ctx[2]->pnext->i);//ok,output:456
printf("%d ", ps1->ctx[3]->pnext->i);/**/////ok,output:456
printf("hello");
}
/**//////////////////////////////////////////////
GPU code(kernel.cu):
typedef struct g_states_t
...{
int i;
struct g_states_t *pnext;
}g_state;
typedef struct ST
...{
g_states_t **cur;
g_states_t *ctx[4];
}ST;
__device__
void setstates(ST *ps, g_states_t states[4])
...{
for (int i = 0; i < 4 ; i++)
...{
ps->ctx[i] = &states[i];
}
}
__global__
void kernel()
...{
g_states_t states[4] =
...{
...{400, &states[1]},
...{401, &states[2]},
...{402, &states[3]},
...{403, &states[0]}
};
ST s1, *ps1;
ps1 = &s1;
setstates(ps1, states);
ps1->ctx[2]->i = 123;//err
ps1->ctx[2]->pnext = &states[0];//err
ps1->ctx[3]->pnext->i = 456;//err
}
////////////////////////////////////
When compile the GPU code in Release mode,prompt:
1>正在执行自定义生成步骤
1>cu_host.cu
1>tmpxft_00001ae8_00000000-3.gpu
1>tmpxft_00001ae8_00000000-7.gpu
1>"E:/MYWIND~1/TEMP/tmpxft_00001ae8_00000000-8.i", line 43: Advisory: Cannot tell what pointer points to, assuming global memory space
1>"E:/MYWIND~1/TEMP/tmpxft_00001ae8_00000000-8.i", line 44: Advisory: Cannot tell what pointer points to, assuming global memory space
1>"E:/MYWIND~1/TEMP/tmpxft_00001ae8_00000000-8.i", line 45: Advisory: Cannot tell what pointer points to, assuming global memory space
1>"E:/MYWIND~1/TEMP/tmpxft_00001ae8_00000000-8.i", line 45: Advisory: Cannot tell what pointer points to, assuming global memory space
1>tmpxft_00001ae8_00000000-3.c
1>tmpxft_00001ae8_00000000-12.i
What's the reason?
Advisory: Cannot tell what pointer points to, assuming global memory space
////
Would you please explain the reason of the problem?
And how to implement the state machine in device code?
Can you tell me the restrict in operation of device memory,such as pointer:
"ps1->ctx[3]->pnext->i"
is this usage legal?
Please read my code in:
http://forums.nvidia.com/index.php?showtopic=61188
- Advisory: Cannot tell what pointer points to, assuming global memory space
- CUDA编程中遇到的警告信息:Warning: Cannot tell what pointer points to, assuming global memory space
- Pointer that points to function (C)
- What To Tell Your Manager In Your Employee Performance Review
- What's the difference between CUDA shared and global memory?
- cuda coalesced access to global memory
- How to Read PGA Memory Advisory Section in AWR and Statspack Reports (文档 ID 786554.1)
- 论文笔记:Aligning where to see and what to tell: image caption with region-based attention ...
- Click to tell us what you think:翻译成多国语言是啥样子
- A easy example to tell you what is "2>&1" in Perl
- What is global registry and how to know a repository is a global registry
- How to check free space on memory card
- Map of Public Vulnerability to Advisory/Alert
- Global Memory Base(1)
- Global Memory Ioctl(2)
- pointer to pointer vs. reference to pointer
- What To Do If mysql Cannot Be Found
- Handling Memory Segments(1)-Using Memory Segments to Describe the GPU Address Space
- FreeMarker 快速入门
- 新的开始
- 从“盗版”说开去
- SD卡和TF卡引脚定义
- java笔记
- Advisory: Cannot tell what pointer points to, assuming global memory space
- 2007年你最想参加哪类技术沙龙?
- 新的家啊~
- ASP.NET 2.0 中的异步页
- VB.Net程序设计:给公司写的一个Excel内容格式转换程序(界面和代码)
- tomcat server.xml web.xml
- VibraCapture: 简单的振动数据采集分析软件
- phpMyAdmin-2.9.1-all-languages 整合到Apache,PHP中
- dsa