Hello,
I'm replying inline below...
On 9/10/21 11:23 AM, 'Jack He CN' via javacpp wrote:
> Hi, there:
>
> I'm new to JavaCPP and trying to write more presets for NVIDIA
> SDK/Libraries following the examples of Samuel on TensorRT.
>
> Here, I still have some questions when reading the presets of TensorRT,
> such as in the file of
> “src/main/java/org/bytedeco\tensorrt\presets\nvinfer.java:
>
> 1..put(new Info("nvinfer1::EnumMax").skip())
>
> This means “nvinfer1::EnumMax” will be skipped for parsing, my question is:
> since this is an inline function which will just return 9 here, so don’t
> need a parse, right? If so, apart from the cases you listed in the doc,
> such as long commented sentences with "//" will be skipped, what are the
> other cases or typical code pieces needs to be skipped?
We would need to give names to those function instances (JavaCPP doesn't
try to do that for templates), but like you said, since they don't look
like useful functions, I've simply opted to skip them. The idea is that
we can skip anything that is cumbersome to map but that doesn't look
useful. When it turns out that something would actually be useful to
have though, we can fix that easily enough in those specific cases.
> 2..put(new Info("nvinfer1::IDimensionExpr"). purify())
>
> This means “nvinfer1::IDimensionExpr” will be an abstract class. My
> question is how to judge that a c++ class should be set with .purify()?
> Only by “deleted constructors”? how to pick all the cases out correctly?
When we get compiler errors about "deleted constructors", yes, that's
the idea.
> 3..put(new info("nvinfer1::IProfiler"). virtualize())
>
> This will add annotation @virtual for this function: “virtual void
> reportLayerTime(const char* layerName, float ms) noexcept = 0;”, again, my
> question is how to find out all the cases quickly without missing.
JavaCPP doesn't have any functionality for that, but there are a lot of
cases when virtual classes in C++ are not actually meant to be
subclassed by users. The overhead required to expose that functionality
to Java is quite high, so even if we added something to pick them all
automatically, you would probably still have to check them all manually
and disable all the ones that are not meant for end users.
> Another thing is, do we have Slack channels which is more effective? Also,
> when I finished coding of preset, how to debug it? Do we have some trouble
> shooting wiki pages?
There's this mailing list, and a chat room at
https://gitter.im/bytedeco/javacpp
We could also set up Slack, but I don't personally find it too great for
community support. Anyway, these days, we have GitHub Discussions, and
that is by far the most "effective" platform, in my opinion:
https://github.com/bytedeco/javacpp/discussions
https://github.com/bytedeco/javacpp-presets/discussions
There's a few wiki pages as well, with the following being most relevant
for your current needs:
https://github.com/bytedeco/javacpp/wiki/Mapping-Recipes
https://github.com/bytedeco/javacpp-presets/wiki/Create-New-Presets
> Thanks in advance,
>
> -jack
>
You're welcome!
Samuel