[Openmp-commits] [openmp] r321264 - [OMPT] Handle null pointer in set_callback to improve performance
Joachim Protze via Openmp-commits
openmp-commits at lists.llvm.org
Thu Dec 21 09:49:27 PST 2017
Thanks for catching this. Pushed.
On 12/21/2017 03:05 PM, Jonas Hahnfeld wrote:
> This is missing the test case, probably you forgot to add the file?
>
> Am 2017-12-21 14:55, schrieb Joachim Protze via Openmp-commits:
>> Author: jprotze
>> Date: Thu Dec 21 05:55:34 2017
>> New Revision: 321264
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=321264&view=rev
>> Log:
>> [OMPT] Handle null pointer in set_callback to improve performance
>>
>> We use the bitmap ompt_enabled thoughout the runtime, to avoid loading
>> the
>> vector of callback functions when testing if specific code should be
>> executed.
>> Before invoking an event callback function, the pointer is tested for
>> NULL.
>>
>> This revision resets the corresponding bit in ompt_enabled to 0 if
>> NULL is passed in set_callback.
>>
>> Differential Revision: https://reviews.llvm.org/D41171
>>
>> Modified:
>> openmp/trunk/runtime/src/ompt-general.cpp
>>
>> Modified: openmp/trunk/runtime/src/ompt-general.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/ompt-general.cpp?rev=321264&r1=321263&r2=321264&view=diff
>>
>> ==============================================================================
>>
>> --- openmp/trunk/runtime/src/ompt-general.cpp (original)
>> +++ openmp/trunk/runtime/src/ompt-general.cpp Thu Dec 21 05:55:34 2017
>> @@ -411,9 +411,12 @@ OMPT_API_ROUTINE int ompt_set_callback(o
>> case event_name:
>> \
>> if (ompt_event_implementation_status(event_name)) {
>> \
>> ompt_callbacks.ompt_callback(event_name) =
>> (callback_type)callback; \
>> - ompt_enabled.event_name = 1;
>> \
>> + ompt_enabled.event_name = (callback != 0);
>> \
>> }
>> \
>> - return ompt_event_implementation_status(event_name);
>> + if (callback)
>> \
>> + return ompt_event_implementation_status(event_name);
>> \
>> + else
>> \
>> + return ompt_set_always;
>>
>> FOREACH_OMPT_EVENT(ompt_event_macro)
>>
>>
>>
>> _______________________________________________
>> Openmp-commits mailing list
>> Openmp-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-commits
--
Dipl.-Inf. Joachim Protze
IT Center
Group: High Performance Computing
Division: Computational Science and Engineering
RWTH Aachen University
Seffenter Weg 23
D 52074 Aachen (Germany)
Tel: +49 241 80- 24765
Fax: +49 241 80-624765
protze at itc.rwth-aachen.de
www.itc.rwth-aachen.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4915 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20171221/eeb07bcd/attachment.bin>
More information about the Openmp-commits
mailing list