C ++ AMP内存泄漏 [英] C++ AMP Memory Leak

查看:82
本文介绍了C ++ AMP内存泄漏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下应用程序代码:

#ifdef _DEBUG
	int flag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
	flag |= _CRTDBG_LEAK_CHECK_DF;
	_CrtSetDbgFlag(flag);
	//_CrtSetBreakAlloc(837); 
#endif

	for (int i = 0; i < 10; i++)
	{
		extent<1> e(10);
		parallel_for_each(e, [=](index<1> idx) restrict(amp) { });
	}

表明C ++ AMP中存在内存泄漏.

reveals that there is a memory leak in C++ AMP.

取消注释"//_ CrtSetBreakAlloc(837);"然后再次运行该应用程序将揭示内存泄漏的根源:

Uncommenting "//_CrtSetBreakAlloc(837);" and running the application again reveals the origin of the memory leak:

我想知道这种泄漏是何时引入的,因为在6到9个月前使用C ++ AMP时,我似乎没有出现内存泄漏的问题.

I wonder when this leak was introduced, as I don't seem to have had problems with memory leakd when using C++ AMP 6-9 months ago.

这似乎是一个非常严重的问题.

This seems to be a quite serious issue.

我已经在两台不同的机器上进行了测试,并且使用了不同的硬件,并且两台机器上都出现了内存泄漏.任何人都可以重现吗?我正在使用Visual Studio 2012(更新2).

I have tested on two different machines, with differing hardware with memory leaks appearing on both. Can anyone reproduce this? I'm using Visual Studio 2012 (Update 2).

推荐答案

似乎驱动程序问题阻止了C ++ AMP释放某些资源.驱动程序卸载/更新后,问题不再存在.
It seems like a driver issue was blocking C++ AMP from releasing some resources. After driver uninstall/update the issue is gone.


这篇关于C ++ AMP内存泄漏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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