Assembla home | Assembla project page
 

Ticket #137 (assigned task)

Opened 2 months ago

Last modified 2 weeks ago

clean up GPU code

Reported by: joaander Assigned to: joaander (accepted)
Priority: blocker Milestone: 0.8.0
Component: Computes (GPU) Keywords:
Cc:

Description (Last modified by joaander)

The GPU kernel code has been a mess since day one when it was written in haste. We need:

  • More consistent file and function names.
  • More consistent use of prefixes on arguments.
  • More consistent argument orderings
  • Better documentation: #98
  • device functions for common tasks (i.e. periodic boundary conditions)
  • template meta-programming where appropriate
  • make GPU data structures classes with device functions for accessing data elements and host functions for allocation and deallocation

Attachments

Change History

09/11/08 20:58:34 changed by joaander

  • status changed from new to assigned.
  • description changed.
  • milestone changed from 0.8.0 to 0.9.0.

Since this is going to be such a sweeping change, that it shouldn't be started so far into the development cycle for 0.8.0. Pushing back to 0.9.0

09/11/08 21:45:23 changed by joaander

  • priority changed from normal to blocker.

09/15/08 13:05:53 changed by joaander

  • milestone changed from 0.9.0 to 0.8.0.

Shifting milestone targets around again. This one won't be as bad as originally thought. It should clean up the memory allocation code considerably.

10/13/08 20:41:25 changed by joaander

r1359 implements a reworked force data structure following the newly created guidelines.

There is still much more to do.

10/14/08 13:59:58 changed by joaander

r1362 fixes bugs created in r1359. HOOMD now runs without crashing.

(follow-up: ↓ 7 ) 10/14/08 14:31:59 changed by phillicl

Are the newly created guidelines documented somewhere?

(in reply to: ↑ 6 ) 10/14/08 14:57:45 changed by joaander

Replying to phillicl:

Are the newly created guidelines documented somewhere?

Yep. You'll need to build the documentation from the latest svn release to get it, but it is under "GPU Implementation" in the developer design notes page.

Note that it is a work in progress and will be updated with more info as I implement each piece. The rest is in my head right now, but I don't want to put it on paper, so to speak, until I've tried it out and see that it will work the way my imagination says it will.

Currently these are the only two points in the updated docs and I haven't completed the reorganization of the code to match them completely yet. # More consistent use of prefixes on arguments. # make GPU data structures classes with device functions for accessing data elements and host functions for allocation and deallocation

The 2nd is the most important and biggest task. GPU data structure allocation, especially with the new multi-GPU stuff is just a big ugly mess right now and it is difficult to impossible to add new stuff (like the virial). Implementing these "lightweight" gpu_*_data_arrays and similar classes with their own internal memory management functions will go a long ways toward fixing that.

See the new gpu_force_data_arrays if you want an example. Though, an examples more relevant to your code will come when I redo the internal data structures of NVTUpdaterGPU.

11/06/08 22:34:29 changed by joaander

r1442 completes the first 3 bullet points on all GPU force computes. The new file/function naming scheme and argument ordering are documented in the developer design notes.

Today, I only had time to rework the force computes. Tomorrow I'll get the other computes, updaters and data structures.

11/07/08 16:49:54 changed by joaander

  • description changed.

r1448 completes a couple of the tasks

  • More consistent file and function names.
  • More consistent argument orderings

The documentation is improved too, but I'm not calling that one complete yet.

The new file naming scheme is beautiful in its simplicity. Most all of the CUDA code is tied in very tightly with a C++ class. So we put the CUDA code that ClassName? class uses in ClassName?.cu and the definitions in ClassName?.cuh. This structure has the added benefit that it will naturally transition to moving all the CUDA code out of the cuda/ directory and in with the rest (to be considered separately in #170).


Add/Change #137 (clean up GPU code)