-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RTC #Line #615
RTC #Line #615
Conversation
Sounds like the best choice, although i agree that the inconcistency feels a bit grim, but probably the most useful / practical option. |
Another thought, re RTC agent functions defined in code. They open the string on it's own line. So presumably the string begins with a newline, so really want to trim that opening newline if it exists, because no one is considering an empty newline line 1 |
a838fc5
to
8cdf82d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you ran the full test suite on this? I get errors with RTC function conditions
[ FAILED ] 2 tests, listed below:
[ FAILED ] DeviceRTCAPITest.AgentFunction_cond_rtc
[ FAILED ] RTCMultiThreadDeviceTest.SameModelMultiDevice_AgentFunctionCondition
[ RUN ] DeviceRTCAPITest.AgentFunction_cond_rtc
---------------------------------------------------
--- JIT compile log for #line 1 "rtc_test_func_impl_condition.cu" ---
---------------------------------------------------
#line 1 "rtc_test_func_impl_condition.cu"(1): error: this declaration has no storage class or type specifier
limits(7): error: expected a ";"
limits(50): warning: parsing restarts here after previous syntax error
limits(51): error: expected a declaration
limits(108): error: expected a declaration
limits(111): warning: parsing restarts here after previous syntax error
limits(112): error: numeric_limits is not a template
limits(113): error: name followed by "::" must be a class or namespace name
limits(113): error: expected an identifier
limits(113): error: not a class or struct name
limits(113): error: class or struct definition is missing
At end of source: warning: parsing restarts here after previous syntax error
At end of source: error: expected a ";"
10 errors detected in the compilation of "#line 1 "rtc_test_func_impl_condition.cu"".
---------------------------------------------------
unknown file: Failure
C++ exception with description "/home/ptheywood/code/flamegpu/FLAMEGPU2/src/flamegpu/util/detail/JitifyCache.cu(331): Error compiling runtime agent function (or function condition) ('rtc_test_func_condition'): function had compilation errors (see std::cout), in JitifyCache::buildProgram()." thrown in the test body.
Nope, will get around to that Monday. Good shout, was supposed to be a simple change. |
I presume it's the same issue I had on agent functions, I just forgot to remove the breaking bit from conditions too. |
It can't be, that's one bit of code so same fix applies. Looking at this, it might not even like the
Edit: Have been able to reproduce this error, it appears to be same issue, with Edit2: Problem was in both, but only visible in agentfn condition, due to bad ifdef. Should have fixed it now, also added missing RTC agent function condition from file method. |
This differs if EXPORT_RTC_SOURCES is enabled, so that line numbers are correct relative to the exported file (which contains injected includes too). Otherwise, line number is at the start of the user defined RTC agent function string, however if the line begins with a linebreak, that opening linebreak is trimmed. Closes #608
This was missed when support for loading RTC agent functions from file was added.
Debug build.
Enabled
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Linux tests now all pass.
This is currently a draft, we need to decide how we want these line numbers to appear.e.g.
If a user has not got
EXPORT_RTC_SOURCES
enabled, then their only reference to line, is the string/file they pass to FLAMEGPU. So first line of that should be line 1 (ignoring injected includes etc).If a user has got
EXPORT_RTC_SOURCES
enabled, then instead it can be assumed they will be referring to the exported files. In which case, the start of that string should be appended#line 2 filename
. 2, because the exported source will include the#line
statement on line 1.I'm not really a fan of this inconsistency, but it makes sense. So if agreed I will tweak the PR to handle those cases.
Addresses #608