In this two weeks connection_pattern
and infer_shape
were merged. I was supposted to implemented the GPU optimization feature. As I don’t have a machine with Nvidia GPU, I truned to the c_code
method after several days.
Reusing the code of CLinker
would be our original idea. But thing wuold not be that simple. CLinker
generate code at a function scale which mean it treat node OpFromGraph
as a function. Yet we want to generate code at a OP scale. Therefore we need to remove some code in a larger scale to make OpFromGraph.c_code()
return a ‘node like’ c_code.
There’re to solution. One is to add a new feature to CLinker
so that it can detect OpFromGraph
node and do some special behavior. The other one is to avoid high level method like code_gen()
in CLinker
– only use auxilary method to assemble a ‘node like’ c_code. The later solution seems easier and I am working on it. CLinker
is a very complicated class, I try to understand it and work out a workable code in the next two weeks.
Wish myself good luck~~!