TiarkRompf / virtualization-lms-core

A Framework for Runtime Code Generation and Compiled DSLs
http://scala-lms.github.com
BSD 3-Clause "New" or "Revised" License
324 stars 91 forks source link

CppHostTransfer Functions and a new data structure? #129

Closed Qiyamah closed 5 years ago

Qiyamah commented 5 years ago

Hi, I have implemented a new data structure which I would like to pass along and my code generation target is CPP.

I think I need to write my own transfer functions for that particular data structure.

emitMakeManifest,emitSend,emitRecv,emitSendView,emitRecvView,emitSendUpdate,emitRecvUpdate

Can you tell me what each of these functions do? And where they are called and how they are called after compilation? A small example would suffice.

Thanks

TiarkRompf commented 5 years ago

The host transfer functions are for interacting with GPU code. If you're looking at plain CPP for CPU execution then you don't need to worry about these. Take a look at the C code generation logic in ArraysOps.scala to see how it works. You will most likely also need to override the "remap" function to print the correct name of your new type in C.