English 中文(简体)
是否能够限制可在加澳新加澳使用的阵列的规模?
原标题:Is there a limit on the size of array that can be used in CUDA?

起草一个计算简单功能组成部分的方案。 在测试时,我发现,如果我使用了1 000多万件大面积,那就会产生错误答案。 我发现,一旦阵列在加澳新集团中被操纵,就会出现错误。 1 000万和以下人员做了出色的工作,产生了正确的结果。

是否可以对可转至万国邮联或根据万国邮联计算的内容数量设定一个规模限制?

P.S. using C style arrays containing floats.

问题回答

你们可以使用多种不同的记忆。 尤其是,

  • Linear Memory (cuMemAlloc)
  • Pinned Memory (cuMemHostAlloc)
  • Zero-Copy Memory (cuMemAllocHost)
  • Pitch Allocation (cuMemAllocPitch)
  • Textures Bound to Linear Memory
  • Textures Bound to CUDA Arrays
  • Textures Bound to Pitch Memory
  • ...and cube maps and surfaces, which I will not list here.

每种类型的记忆都与自己的硬件资源限额有关,其中许多可以通过使用<代码>cuDeviceGetAttribute<>。 cuMemGetInfo> 退还该装置上的自由和全部记忆,但因调和要求,分配1,000,000 浮标可能产生超过<条码>1 000 000(float)的体积。 您可以一度安排的最大区块数目也是一种限制:如果你超过,油轮将无法发射(你可以很容易地利用<代码>cuDeviceGetAttribute<>)。 你们可以找到使用“CUDA”司机APICA不同记忆量的统一要求,但就简单的方案而言,你可以进行合理的猜测,检查分配职能的价值,以确定分配是否成功。

There is no restriction on the amount of bytes that you can transfer; using asynchronous functions, you can overlap kernel execution with memory copying (providing that your card supports this). Exceeding the maximum number of blocks you can schedule, or consuming the available memory on your device means that you will have to split up your task so that you can use multiple kernels to handle it.

For compute capability>=3.0 the max grid dimensions are 2147483647x65535x65535, so for a that should cover any 1-D array of sizes up to 2147483647x1024 = 2.1990233e+12.

10亿个元素阵列肯定是罚款。

1 000 000 000 000 000 000 000/1024=976562.5, 共976563个区块。 仅能确保,如果read子X+blockIdx.*blockDim.x>=你未经加工从油轮返回的人数。





相关问题
Undefined reference

I m getting this linker error. I know a way around it, but it s bugging me because another part of the project s linking fine and it s designed almost identically. First, I have namespace LCD. Then I ...

C++ Equivalent of Tidy

Is there an equivalent to tidy for HTML code for C++? I have searched on the internet, but I find nothing but C++ wrappers for tidy, etc... I think the keyword tidy is what has me hung up. I am ...

Template Classes in C++ ... a required skill set?

I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

typedef ing STL wstring

Why is it when i do the following i get errors when relating to with wchar_t? namespace Foo { typedef std::wstring String; } Now i declare all my strings as Foo::String through out the program, ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

Window iconification status via Xlib

Is it possible to check with the means of pure X11/Xlib only whether the given window is iconified/minimized, and, if it is, how?

热门标签