commit 8d0b3533918fca2578120fc0a0383ce5111278dc Author: Alexis Pereda Date: Mon May 10 18:11:23 2021 +0200 thesis version diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..634ebb4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +build/ +debug/ +clang/ +release/ +.old +*.pyc diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..5758d48 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,198 @@ +cmake_minimum_required(VERSION 3.0) +get_filename_component(project_name ${CMAKE_CURRENT_SOURCE_DIR} NAME) +project(${project_name}) + +set(EXTENSION "cpp") + +set(CMAKE_C_STANDARD 99) +set(CMAKE_CXX_STANDARD 14) + +set(GEN_BINARY OFF) +set(GEN_LIBRARY OFF) +set(LIB_TYPE STATIC) # NONE, STATIC, SHARED, MODULE +set(LIBS_TYPE STATIC) + +set(FLAGS_ANY "-Wall -Wextra -fopenmp -Winline -Wfatal-errors") +set(FLAGS_DEBUG "-DDEBUG -Og -g -fsanitize=thread") +set(FLAGS_RELEASE "-DNDEBUG -O2") + +set(SRCDIRS src) +set(LIBSDIRS libsrc) +set(TESTSDIRS tests) +set(EXAMPLESDIRS examples benchmarks) +set(MANDIR man) + +set(INCLUDE_DIRS inc) +set(LIBRARIES "") + +set(USER_LIBRARIES "") + +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${FLAGS_ANY}") +set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${FLAGS_ANY} ${FLAGS_DEBUG}") +set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${FLAGS_ANY} ${FLAGS_RELEASE}") + +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLAGS_ANY}") +set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${FLAGS_ANY} ${FLAGS_DEBUG}") +set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${FLAGS_ANY} ${FLAGS_RELEASE}") + +if(USE_SANITIZER STREQUAL "Address") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address") +elseif(USE_SANITIZER STREQUAL "Leak") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=leak") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=leak") +elseif(USE_SANITIZER STREQUAL "Thread") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=thread") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=thread") +elseif(USE_SANITIZER STREQUAL "Undefined") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=undefined") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined") +endif() + +## Libraries +if(NOT ${LIB_TYPE} MATCHES "^NONE$") + # Project library + if(GEN_LIBRARY) + set(lib_src "") + foreach(srcdir ${SRCDIRS}) + set(srcpath ${CMAKE_CURRENT_SOURCE_DIR}/${srcdir}) + file(GLOB_RECURSE tmpsrc ${srcpath}/*.${EXTENSION}) + list(APPEND lib_src ${tmpsrc}) + endforeach() + + set(lib ${PROJECT_NAME}) + if(lib_src) + message(STATUS "+ Library: ${lib}") + add_library(${lib} ${LIB_TYPE} ${lib_src}) + target_include_directories(${lib} PUBLIC ${INCLUDE_DIRS}) + target_link_libraries(${lib} ${LIBRARIES}) + list(APPEND USER_LIBRARIES ${lib}) + else() + message(WARNING "! Library ${lib}: no sources") + endif() + endif() +endif() + +## Other libraries +if(NOT ${LIBS_TYPE} MATCHES "^NONE$") + foreach(libsdir ${LIBSDIRS}) + set(libspath ${CMAKE_CURRENT_SOURCE_DIR}/${libsdir}) + file(GLOB libs RELATIVE ${libspath} ${libspath}/*) + if(libs) + foreach(child ${libs}) + set(lib "") + if(IS_DIRECTORY ${libspath}/${child}) + set(lib ${child}) + file(GLOB_RECURSE lib_src ${libspath}/${child}/*.${EXTENSION}) + else() + message(WARNING "! Ignoring file: ${libsdir}/${child}") + endif() + if(lib) + if(lib_src) + message(STATUS "+ Library: ${lib}") + add_library(${lib} ${LIBS_TYPE} ${lib_src}) + target_include_directories(${lib} PUBLIC ${INCLUDE_DIRS}) + target_link_libraries(${lib} ${LIBRARIES}) + list(APPEND USER_LIBRARIES ${lib}) + else() + message(WARNING "! Library ${lib}: no sources") + endif() + endif() + endforeach() + endif() + endforeach() +endif() + +## Binary +if(GEN_BINARY) + set(src "") + foreach(srcdir ${SRCDIRS}) + set(srcpath ${CMAKE_CURRENT_SOURCE_DIR}/${srcdir}) + file(GLOB_RECURSE tmpsrc ${srcpath}/*.${EXTENSION}) + list(APPEND src ${tmpsrc}) + endforeach() + set(bin ${PROJECT_NAME}) + if(src) + if(GEN_LIBRARY) + set(bin ${bin}.bin) + endif() + message(STATUS "+ Binary: ${bin}") + add_executable(${bin} ${src}) + target_include_directories(${bin} PUBLIC ${LIBSDIRS} ${INCLUDE_DIRS}) + target_link_libraries(${bin} ${LIBRARIES} ${USER_LIBRARIES}) + else() + message(WARNING "! Binary ${bin}: no sources") + endif() +endif() + +## Tests +foreach(testsdir ${TESTSDIRS}) + set(testspath ${CMAKE_CURRENT_SOURCE_DIR}/${testsdir}) + file(GLOB_RECURSE tests_src ${testspath}/*.${EXTENSION}) + if(tests_src) + set(tests ${testsdir}_${PROJECT_NAME}) + message(STATUS "+ Tests: ${tests}") + add_executable(${tests} ${tests_src}) + target_include_directories(${tests} PUBLIC ${SRCDIRS} ${LIBSDIRS} ${INCLUDE_DIRS}) + target_link_libraries(${tests} ${LIBRARIES} ${USER_LIBRARIES}) + endif() +endforeach() + +## Examples +foreach(examplesdir ${EXAMPLESDIRS}) + set(examplespath ${CMAKE_CURRENT_SOURCE_DIR}/${examplesdir}) + file(GLOB examples RELATIVE ${examplespath} ${examplespath}/*) + if(examples) + foreach(child ${examples}) + set(example_bin_filename "") + set(example "") + if(IS_DIRECTORY ${examplespath}/${child}) + set(example_bin_filename ${child}) + set(example ${examplesdir}_${example_bin_filename}) + file(GLOB_RECURSE example_src ${examplespath}/${child}/*.${EXTENSION}) + else() + get_filename_component(extension ${child} EXT) + if(${extension} MATCHES "^.${EXTENSION}$") + get_filename_component(example_name ${child} NAME_WE) + set(example_bin_filename ${example_name}) + set(example ${examplesdir}_${example_bin_filename}) + set(example_src ${examplespath}/${child}) + endif() + endif() + if(example) + if(example_src) + message(STATUS "+ Example: ${examplesdir}/${example}") + add_executable(${example} ${example_src}) + target_include_directories(${example} PUBLIC ${SRCDIRS} ${LIBSDIRS} ${INCLUDE_DIRS}) + target_link_libraries(${example} ${LIBRARIES} ${USER_LIBRARIES}) + set_target_properties(${example} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${examplesdir}) + set_target_properties(${example} PROPERTIES OUTPUT_NAME ${example_bin_filename}) + else() + message(WARNING "! Example ${example}: no sources") + endif() + endif() + endforeach() + endif() +endforeach() + +## Man pages +set(MANPATH ${CMAKE_CURRENT_SOURCE_DIR}/${MANDIR}) +set(MAN_OUTPATH ${CMAKE_BINARY_DIR}/deb/usr/share/man) +file(GLOB_RECURSE man_src RELATIVE ${MANPATH} ${MANPATH}/*) +if(man_src) + set(man_outfiles "") + foreach(man_file IN LISTS man_src) + set(man_outfile ${MAN_OUTPATH}/${man_file}.gz) + get_filename_component(man_outdir ${man_outfile} DIRECTORY) + list(APPEND man_outfiles ${man_outfile}) + message(STATUS "+ manpage: ${man_file}") + add_custom_command(OUTPUT ${man_outfile} + COMMAND ${CMAKE_COMMAND} -E make_directory ${man_outdir} + COMMAND ${CMAKE_COMMAND} -E copy ${MANPATH}/${man_file} ${MAN_OUTPATH}/${man_file} + COMMAND gzip -f ${MAN_OUTPATH}/${man_file} + DEPENDS ${MANPATH}/${man_file}) + endforeach() + add_custom_target(man ALL DEPENDS ${man_outfiles}) +endif() diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..ffdc907 --- /dev/null +++ b/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + pfor + Copyright (C) 2021 phd / dev + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) 2021 phd / dev + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/README.md b/README.md new file mode 100644 index 0000000..868891d --- /dev/null +++ b/README.md @@ -0,0 +1,142 @@ +# About + +This is an active library, using C++ template metaprogramming, to automate loop parallelisation. +This work has been done for my Ph.D. thesis. + +## Brief + +It uses [expression templates](https://en.wikipedia.org/wiki/Expression_templates) and an [EDSL](https://en.wikipedia.org/wiki/Domain-specific_language) +to build an [AST](https://en.wikipedia.org/wiki/AST) of loops at compile-time. +This AST is analysed to determine first which instructions of a given loop are interdependent, then for each instruction group +if it can be run in parallel with itself at different iterations of the loop. +The interdependence of instructions relies on how variables are accessed (read/write). +To identify instruction groups that can be run in parallel, the library uses index functions (in array accesses) and a set of rules +depending on these functions. +According to this, the library generates sequential and/or parallel loops. + +## Example + +Given this source code: +```cpp +// a, b, c, d, e and f are arrays +for(int i = 0; i < n; ++i) { + a[i] = a[i] * b[i]; + c[i] = c[i+1] - d[i]; + b[i] = b[i] + i; + d[i] = std::pow(c[i], e[i]); + f[i*i] = 2 * f[i*i]; +} +``` + +By writing it like this: +```cpp +// a, b, c, d, e and f are expression template operands +// pow is an automatically generated expression template function +Index i; +parallelFor(Range{0, n}, + a[i] = a[i] * b[i], + c[i] = c[i+ctv<1>] + d[i], + b[i] = b[i] + i, + d[i] = pow(c[i], e[i]), + f[injective(i*i)] = 2 * f[injective(i*i)] +); +``` + +The library will automatically produce these two loops: +```bash +for(int i = 0; i < n; ++i) { + c[i] = c[i+1] + d[i]; + d[i] = std::pow(c[i], e[i]); +} + +# pragma omp parallel for +for(int i = 0; i < n; ++i) { + a[i] = a[i] * b[i]; + b[i] = b[i] + i; + f[i*i] = 2 * f[i*i]; +} +``` + +## Performances + +### Compilation time + +This library runs mostly during the compilation and therefore extends its duration. +We ran tests for four sets of source codes: + +
    +
  • "dep/fixed" corresponding to dependent instructions with common index functions; + +
  • +
  • "indep/fixed" corresponding to independent instructions with common index functions;
  • +
  • "dep/rand" corresponding to dependent instructions with random index functions;
  • +
  • "indep/rand" corresponding to independent instructions with random index functions.
  • +
+ +For more specific information, see the `ctbenchmarks` directory. + +The compilation time is not significantly affected by the number of loops as shown below: + +
+ +As expected, however, the compilation time increases (exponentially) with the number of instructions inside an unique loop: + +
+ +This could be improved but was not a priority as usually a single loop does not run so many instructions. + +### Execution time + +The point of the library is to provide a solution to automatically run in parallel whenever possible, +not to do better than what one can expect from classic parallelisation tools like [OpenMP](https://www.openmp.org/). +In contrast, when a loop cannot be run in parallel, the library should not cause runtime overhead. + +We ran tests with and without using the library: + +
    +
  • "seq" corresponding to a sequential execution without the library; + +
  • +
  • "omp" corresponding to a parallel execution without the library, using OpenMP, when applicable;
  • +
  • "gen_omp" corresponding to a parallel execution with the library generating OpenMP code;
  • +
  • "gen_thread" corresponding to a parallel execution with the library generating multi-threaded loop.
  • +
+ +For both "gen_omp" and "gen_thread", the library will actually generate a sequential code if the loop cannot be run in parallel. + +The two figures below shows that using the library does not induce significant runtime overhead, both for sequential and +parallel (with 18 cores) executions: + +
+
+ +Obtained speed up is equivalent using the library with respect to a handwritten OpenMP program: + +
+ +## Related publications + +- "Static Loop Parallelization Decision Using Template Metaprogramming", HPCS 2018 (IEEE) [10.1109/HPCS.2018.00159](https://doi.org/10.1109/HPCS.2018.00159) + +## Organisation + +Main directories: +- `src/pfor`: the library sources; +- `examples`: some examples using the library; +- `[cr]tbenchmarks`: scripts for compile-time/run-time benchmarking; +- `results`: results presented in the thesis, obtained using mentioned scripts and codes. + +## Usage + +To produce the `Makefile` and build the project: +```bash +mkdir build +cd build +cmake -DCMAKE_BUILD_TYPE=Release .. +make +``` + +To run examples: +```bash +./build/examples/${example_name} +``` diff --git a/benchmarks/basic.cpp b/benchmarks/basic.cpp new file mode 100644 index 0000000..40bead0 --- /dev/null +++ b/benchmarks/basic.cpp @@ -0,0 +1,231 @@ +#include +#include +#include +#include + +#include "common.h" + +constexpr std::size_t K = 1'000; + +std::size_t pfor::ParallelForParameters::nThreads{1}; + +struct Arguments { + std::size_t arraySize; + std::string method; + std::size_t sample; +}; + +Arguments processCLA(int argc, char** argv) { + if(argc < 4) { + std::cerr << "Usage: " << *argv << " N method #sample [nThreads]" << std::endl; + std::cerr << " N: array size (1..1000000)" << std::endl; + std::cerr << " method: {seq, omp, gen_omp, gen_thread}" << std::endl; + std::cerr << " #sample: {0: full sequential, 1: full parallel, 2: mixed sequential/parallel}" << std::endl; + std::cerr << " nThreads: defaults to 1" << std::endl; + std::exit(1); + } + + Arguments args; + + { + std::istringstream iss{argv[1]}; + iss >> args.arraySize; + } + args.method = std::string{argv[2]}; + { + std::istringstream iss{argv[3]}; + iss >> args.sample; + } + + if(argc >= 5) { + std::istringstream iss{argv[4]}; + iss >> pfor::ParallelForParameters::nThreads; + } + + + if(args.arraySize < 1 || args.arraySize > 10000000) { + std::cerr << "N out of bounds" << std::endl; + std::exit(1); + } + + if(args.method != "seq" && args.method != "omp" && args.method != "gen_omp" && args.method != "gen_thread") { + std::cerr << "method out of bounds" << std::endl; + std::exit(1); + } + + if(args.sample > 2) { + std::cerr << "#sample out of bounds" << std::endl; + std::exit(1); + } + + if(args.method == "omp" && args.sample == 0) { + std::cerr << "incoherent method/#sample" << std::endl; + std::exit(1); + } + + return args; +} + +using T = int; + +int main(int argc, char **argv) { + Arguments args = processCLA(argc, argv); + long const N = args.arraySize; + + OPERAND(T, a0, N, i++); + OPERAND(T, a1, N, i++); + OPERAND(T, a2, N, i++); + OPERAND(T, a3, N, i++); + OPERAND(T, a4, N, i++); + OPERAND(T, a5, N, i++); + OPERAND(T, a6, N, i++); + OPERAND(T, a7, N, i++); + + if(args.sample == 0) { +/* + * Sample 0: sequential + */ + // arraysPrinter(K, N, a0, a1, a2, a5); + + if(args.method == "seq") { + BENCH(K) + for(long i = 0; i < N-1; ++i) { + a0_[i] = a0_[i+1] + a1_[i] * a2_[i]; + a1_[i] = a1_[i+1] + a2_[i] * a3_[i]; + a2_[i] = a2_[i+1] + a3_[i] * a4_[i]; + a5_[i] = a5_[i+1] + a6_[i] * a7_[i]; + } + END_BENCH(); + } else if(args.method == "gen_omp") { + BENCH(K) + pfor::parallelFor(pfor::Range{0, N-1}, [&](pfor::Index i) { + return + a0[i] = a0[i+_<1>] + a1[i] * a2[i], + a1[i] = a1[i+_<1>] + a2[i] * a3[i], + a2[i] = a2[i+_<1>] + a3[i] * a4[i], + a5[i] = a5[i+_<1>] + a6[i] * a7[i]; + }); + END_BENCH(); + } else if(args.method == "gen_thread") { + BENCH(K) + pfor::parallelFor(pfor::Range{0, N-1}, [&](pfor::Index i) { + return + a0[i] = a0[i+_<1>] + a1[i] * a2[i], + a1[i] = a1[i+_<1>] + a2[i] * a3[i], + a2[i] = a2[i+_<1>] + a3[i] * a4[i], + a5[i] = a5[i+_<1>] + a6[i] * a7[i]; + }); + END_BENCH(); + } + + // arraysPrinter(K, N, a0, a1, a2, a5); + } else if(args.sample == 1) { +/* + * Sample 1: parallel + */ + if(args.method == "seq") { + BENCH(K) + for(long i = 0; i < N; ++i) { + a0_[i] = a0_[i] + a1_[i] * a2_[i]; + a1_[i] = a1_[i] + a2_[i] * a3_[i]; + a2_[i] = a2_[i] + a3_[i] * a4_[i]; + a5_[i] = a5_[i] + a6_[i] * a7_[i]; + } + END_BENCH(); + } else if(args.method == "omp") { + BENCH(K) + #pragma omp parallel for num_threads(pfor::ParallelForParameters::nThreads) + for(long i = 0; i < N; ++i) { + a0_[i] = a0_[i] + a1_[i] * a2_[i]; + a1_[i] = a1_[i] + a2_[i] * a3_[i]; + a2_[i] = a2_[i] + a3_[i] * a4_[i]; + a5_[i] = a5_[i] + a6_[i] * a7_[i]; + } + END_BENCH(); + } else if(args.method == "gen_omp") { + BENCH(K) + pfor::parallelFor(pfor::Range{0, N}, [&](pfor::Index i) { + return + a0[i] = a0[i] + a1[i] * a2[i], + a1[i] = a1[i] + a2[i] * a3[i], + a2[i] = a2[i] + a3[i] * a4[i], + a5[i] = a5[i] + a6[i] * a7[i]; + }); + END_BENCH(); + } else if(args.method == "gen_thread") { + BENCH(K) + pfor::parallelFor(pfor::Range{0, N}, [&](pfor::Index i) { + return + a0[i] = a0[i] + a1[i] * a2[i], + a1[i] = a1[i] + a2[i] * a3[i], + a2[i] = a2[i] + a3[i] * a4[i], + a5[i] = a5[i] + a6[i] * a7[i]; + }); + END_BENCH(); + } + } else if(args.sample == 2) { +/* + * Sample 2: mixed sequential and parallel + */ + // arraysPrinter(K, N, a0, a1, a2, a3, a4, a5, a6, a7); + + if(args.method == "seq") { + BENCH(K) + for(long i = 0; i < N-1; ++i) { + a0_[i] = a0_[i] + a1_[i] * a2_[i]; + a1_[i] = a1_[i] + a2_[i] * a3_[i]; + } + for(long i = 0; i < N-1; ++i) { + a4_[i] = a4_[i+1] + a5_[i] * a7_[i]; + a5_[i] = a5_[i+1] + a6_[i] * a7_[i]; + } + END_BENCH(); + } else if(args.method == "omp") { + BENCH(K) + #pragma omp parallel for num_threads(pfor::ParallelForParameters::nThreads) + for(long i = 0; i < N-1; ++i) { + a0_[i] = a0_[i] + a1_[i] * a2_[i]; + a1_[i] = a1_[i] + a2_[i] * a3_[i]; + } + // Sequential + for(long i = 0; i < N-1; ++i) { + a4_[i] = a4_[i+1] + a5_[i] * a7_[i]; + a5_[i] = a5_[i+1] + a6_[i] * a7_[i]; + } + END_BENCH(); + } else if(args.method == "gen_omp") { + BENCH(K) + pfor::parallelFor(pfor::Range{0, N-1}, [&](pfor::Index i) { + return + a0[i] = a0[i] + a1[i] * a2[i], + a1[i] = a1[i] + a2[i] * a3[i], + a4[i] = a4[i+_<1>] + a5[i] * a7[i], + a5[i] = a5[i+_<1>] + a6[i] * a7[i]; + }); + END_BENCH(); + } else if(args.method == "gen_thread") { + BENCH(K) + pfor::parallelFor(pfor::Range{0, N-1}, [&](pfor::Index i) { + return + a0[i] = a0[i] + a1[i] * a2[i], + a1[i] = a1[i] + a2[i] * a3[i], + a4[i] = a4[i+_<1>] + a5[i] * a7[i], + a5[i] = a5[i+_<1>] + a6[i] * a7[i]; + }); + END_BENCH(); + } + + // arraysPrinter(K, N, a0, a1, a2, a3, a4, a5, a6, a7); + } + + if(rand()==rand()) arraysPrinter(1ul, N, a0_, a1_, a2_, a3_, a4_, a5_, a6_, a7_); + + END_OPERAND(a0); + END_OPERAND(a1); + END_OPERAND(a2); + END_OPERAND(a3); + END_OPERAND(a4); + END_OPERAND(a5); + END_OPERAND(a6); + END_OPERAND(a7); +} diff --git a/benchmarks/common.h b/benchmarks/common.h new file mode 100644 index 0000000..d805e9b --- /dev/null +++ b/benchmarks/common.h @@ -0,0 +1,65 @@ +#ifndef PFOR_BENCHMARKS_COMMON_H +#define PFOR_BENCHMARKS_COMMON_H + +#include +#include +#include + +#include + +template +constexpr auto _ = pfor::ctv; + +using TimePoint = std::tuple; + +TimePoint timepoint() { + struct rusage usage; + getrusage(RUSAGE_SELF, &usage); + + long realSec = usage.ru_utime.tv_sec + usage.ru_stime.tv_sec; + long realUsec = usage.ru_utime.tv_usec + usage.ru_stime.tv_usec; + + return {realSec, realUsec}; +} + +double timediff(TimePoint const& from, TimePoint const& to) { + return std::get<0>(to)-std::get<0>(from) + (std::get<1>(to)-std::get<1>(from))/1'000'000.; +} + +// Operand utility +#define OPERAND(Type, name, size, filler) \ + Type * name##_ = new Type[size]; \ + { \ + std::size_t i = 0; \ + std::generate_n(name##_, size, [&i]{ return filler; }); \ + } \ + auto name = pfor::Operand(name##_); + +#define END_OPERAND(name) delete[] name##_ + +// Bench utility +#define BENCH(K) { \ + TimePoint tp0 = timepoint(); \ + for(std::size_t k_ = 0; k_ < K; ++k_) { + +#define END_BENCH() } \ + TimePoint tp1 = timepoint(); \ + std::cout << "time: " << timediff(tp0, tp1) << std::endl; \ + } + +template +void arraysPrinter(K, S) {} + +template +void arraysPrinter(K k, S n, T&& array, Ts&&... arrays) { + if(k != 1) { + std::cerr << "warning: displays may be false, must set K to 1" << std::endl; + std::exit(1); + } + for(S i = 0; i < n; ++i) + std::cout << std::forward(array)[i] << ", "; + std::cout << std::endl; + arraysPrinter(k, n, std::forward(arrays)...); +} + +#endif diff --git a/benchmarks/imgpro.cpp b/benchmarks/imgpro.cpp new file mode 100644 index 0000000..7bb8a1a --- /dev/null +++ b/benchmarks/imgpro.cpp @@ -0,0 +1,101 @@ +#include +#include +#include +#include +#include + +#include "common.h" + +constexpr std::size_t K = 1; + +constexpr long W = 100'001; +constexpr long H = 100'000; + +std::size_t pfor::ParallelForParameters::nThreads{1}; + +struct Arguments { + std::string method; +}; + +Arguments processCLA(int argc, char** argv) { + if(argc < 2) { + std::cerr << "Usage: " << *argv << " method [nThreads]" << std::endl; + std::cerr << " method: {seq, omp, gen_omp, gen_thread}" << std::endl; + std::cerr << " nThreads: defaults to 1" << std::endl; + std::exit(1); + } + + Arguments args; + + args.method = std::string{argv[1]}; + + if(argc >= 3) { + std::istringstream iss{argv[2]}; + iss >> pfor::ParallelForParameters::nThreads; + } + + + if(args.method != "seq" && args.method != "omp" && args.method != "gen_omp" && args.method != "gen_thread") { + std::cerr << "method out of bounds" << std::endl; + std::exit(1); + } + + return args; +} + +char r(int c) { return (c>>24&0xff); } +char g(int c) { return (c>>16&0xff); } +char b(int c) { return (c>>8&0xff); } +char a(int c) { return (c>>0&0xff); } + +int main(int argc, char** argv) { + Arguments args = processCLA(argc, argv); + + auto img_ = new int[W*H]; // 4 channels (rgba); W*H image + auto img = pfor::Operand{img_}; + + auto calc_ = [](int n, int w, int s, int e) { + auto volatile c = 0; + for(int i = 0; i < 10; ++i) ++c; + return (n+w+s+e)/4; + }; + auto calc = pfor::makeOperator(calc_); + + if(args.method == "seq") { + BENCH(K) + for(long i = W+1; i < (H-1)*W; i += 2) { + img_[i] = calc_(img_[i-W], img_[i-1], img_[i+W], img_[i+1]); + } + END_BENCH(); + } else if(args.method == "omp") { + BENCH(K) + #pragma omp parallel for num_threads(pfor::ParallelForParameters::nThreads) + for(long i = W+1; i < (H-1)*W; i += 2) { + img_[i] = calc_(img_[i-W], img_[i-1], img_[i+W], img_[i+1]); + } + END_BENCH(); + } else if(args.method == "gen_omp") { + BENCH(K) + pfor::Index i; + pfor::parallelFor(pfor::RangeCT{(H-1)*W}, + // pfor::parallelFor(pfor::Range{W+1, (H-1)*W, 1}, + img[i] = calc(img[i-_], img[i-_<1>], img[i+_], img[i+_<1>]) + ); + END_BENCH(); + } else if(args.method == "gen_thread") { + BENCH(K) + pfor::Index i; + pfor::parallelFor(pfor::RangeCT{(H-1)*W}, + img[i] = calc(img[i-_], img[i-_<1>], img[i+_], img[i+_<1>]) + ); + END_BENCH(); + } + + if(rand()==rand()) { + for(long i = 0; i +#include +#include +#include + +#include "common.h" + +constexpr std::size_t K = 1'000; + +std::size_t pfor::ParallelForParameters::nThreads{1}; + +struct Arguments { + std::size_t arraySize; + std::string method; +}; + +Arguments processCLA(int argc, char **argv) { + if(argc < 2) { + std::cerr << "Usage: " << *argv << " N method" << std::endl; + std::cerr << " N: array size (1..1000000)" << std::endl; + std::cerr << " method: {seq, gen}" << std::endl; + std::exit(1); + } + + Arguments args; + + { + std::istringstream iss{argv[1]}; + iss >> args.arraySize; + } + args.method = std::string{argv[2]}; + + if(args.arraySize < 1 || args.arraySize > 1000000) { + std::cerr << "N out of bounds" << std::endl; + std::exit(1); + } + + if(args.method != "seq" && args.method != "gen") { + std::cerr << "method out of bounds" << std::endl; + std::exit(1); + } + + return args; +} + +using T = int; + +int main(int argc, char **argv) { + Arguments args = processCLA(argc, argv); + std::size_t const N = args.arraySize; + + OPERAND(T, a0, N, i++); + OPERAND(T, a1, N, i++); + OPERAND(T, a2, N, i++); + OPERAND(T, a3, N, i++); + OPERAND(T, a4, N, i++); + OPERAND(T, a5, N, i++); + OPERAND(T, a6, N, i++); + OPERAND(T, a7, N, i++); + +/* +* Sample 0: sequential +*/ + // arraysPrinter(K, N, a0, a1, a2, a5); + + if(args.method == "seq") { + BENCH(K) + for(std::size_t i = 0; i < N-1; ++i) { + a0_[i] = a0_[i+1] + a1_[i] * a2_[i]; + a1_[i] = a1_[i+1] + a2_[i] * a3_[i]; + a2_[i] = a2_[i+1] + a3_[i] * a4_[i]; + a5_[i] = a5_[i+1] + a6_[i] * a7_[i]; + } + END_BENCH(); + } else if(args.method == "gen") { + BENCH(K) + pfor::parallelFor(pfor::Range{0, static_cast(N-1)}, [&](pfor::Index i) { + return + a0[i] = a0[i+_<1>] + a1[i] * a2[i], + a1[i] = a1[i+_<1>] + a2[i] * a3[i], + a2[i] = a2[i+_<1>] + a3[i] * a4[i], + a5[i] = a5[i+_<1>] + a6[i] * a7[i]; + }); + END_BENCH(); + } + + if(rand() == rand()) arraysPrinter(1, N, a0_, a1_, a2_, a3_, a4_, a5_, a6_, a7_); + + END_OPERAND(a0); + END_OPERAND(a1); + END_OPERAND(a2); + END_OPERAND(a3); + END_OPERAND(a4); + END_OPERAND(a5); + END_OPERAND(a6); + END_OPERAND(a7); +} diff --git a/ctbenchmarks/.gitignore b/ctbenchmarks/.gitignore new file mode 100644 index 0000000..838c97b --- /dev/null +++ b/ctbenchmarks/.gitignore @@ -0,0 +1,8 @@ +build/ +debug/ +clang/ +release/ +data/ +datam/ +srcs/ +plots/ diff --git a/ctbenchmarks/gen_ct b/ctbenchmarks/gen_ct new file mode 100755 index 0000000..9dcb4fd --- /dev/null +++ b/ctbenchmarks/gen_ct @@ -0,0 +1,168 @@ +#!/bin/bash + +rand() { + echo $((RANDOM%($2-$1)+$1)) +} + +index_expr_rand() { + echo "pfor::ctv<$(rand 0 100)>*i+pfor::ctv<$(rand 0 100)>" +} + +index_expr_fixed() { + echo "pfor::ctv<3>*i+pfor::ctv<2>" +} + +header() { + cat< +#include + +std::size_t pfor::ParallelForParameters::nThreads = 16; + +constexpr unsigned n = BUFSIZ; + +int main() { + pfor::Index i; +EOF +} + +footer() { + cat<{v${i}_};" +} + +independent_with() { + index_expr_str=$1; shift + index_expr() { + eval ${index_expr_str} + } + for i in $@; do + echo -ne ",\n\t\tv${i}[$(index_expr)] = v1[$(index_expr)]" + done +} + +dependent_with() { + index_expr_str=$1; shift + index_expr() { + eval ${index_expr_str} + } + ii=$1; shift + for i in $@; do + echo -ne ",\n\t\tv${i}[$(index_expr)] = v${ii}[$(index_expr)]" + ii=$i + done +} + +#### + +fixed_count=100 + +fixed_var_count() { + mode=$1; shift + opening=$1; shift + index_expr_str=$1; shift + + header + for i in $(seq ${fixed_count}); do + variable "${i}" + done + + echo -ne "\t${opening}" + eval "${mode} '${index_expr_str}' $*" + echo -e "\n\t);" + + footer +} + +fixed_instr_count() { + mode=$1; shift + opening=$1; shift + index_expr_str=$1; shift + var_count=$1 + + [ "${mode}" = 'dependent_with' ] && vars='1 ' || vars= + + ntimes=$(((fixed_count+(var_count-1)-1)/(var_count-1) - 1)) + vars_last="${vars}$(seq -s' ' 2 $((fixed_count-ntimes*(var_count-1) + 1)))" + vars="${vars}$(seq -s' ' 2 ${var_count})" + + header + for i in $(seq ${var_count}); do + variable "${i}" + done + + echo -ne "\t${opening}" + for i in $(seq ${ntimes}); do + eval "${mode} '${index_expr_str}' ${vars}" + done + eval "${mode} '${index_expr_str}' ${vars_last}" + echo -e "\n\t);" + + footer +} + +fixed_instr_var_count() { + mode=$1; shift + opening=$1; shift + index_expr_str=$1; shift + loop_count=$1 + + [ "${mode}" = 'dependent_with' ] && first_=1 || first_=2 + [ "${mode}" = 'dependent_with' ] && offset=0 || offset=-1 + + instr_count=$((fixed_count/loop_count)) + remainder=$((fixed_count - instr_count*loop_count)) + + header + for i in $(seq ${fixed_count}); do + variable "${i}" + done + + first=${first_} + for i in $(seq $((loop_count))); do + n=$((instr_count + ! ! remainder)) + last=$((first + n + offset)) + if [ ${last} -gt ${fixed_count} ]; then + first=${first_} + last=$((first + n + offset)) + fi + + echo -ne "\t${opening}" + eval "${mode} '${index_expr_str}' $(seq -s' ' ${first} ${last})" + echo -e "\n\t);" + + first=$((last+1)) + + remainder=$((remainder > 0 ? remainder-1 : 0)) + done + + footer +} + +#### + +outdir=srcs +opening='pfor::parallelFor(pfor::RangeCT<0,2>{n}' + +for count in $(echo 5 $(seq 10 10 100)); do + fixed_var_count>"${outdir}/main_fixedv_indep_randi_${count}.cpp" independent_with "${opening}" 'index_expr_rand' $(seq 2 ${count}) + fixed_var_count>"${outdir}/main_fixedv_dep_randi_${count}.cpp" dependent_with "${opening}" 'index_expr_rand' $(seq ${count}) + fixed_var_count>"${outdir}/main_fixedv_indep_fixedi_${count}.cpp" independent_with "${opening}" 'index_expr_fixed' $(seq 2 ${count}) + fixed_var_count>"${outdir}/main_fixedv_dep_fixedi_${count}.cpp" dependent_with "${opening}" 'index_expr_fixed' $(seq ${count}) + + # fixed_instr_count>"${outdir}/main_fixedi_indep_randi_${count}.cpp" independent_with "${opening}" 'index_expr_rand' "${count}" + # fixed_instr_count>"${outdir}/main_fixedi_dep_randi_${count}.cpp" dependent_with "${opening}" 'index_expr_rand' "${count}" + # fixed_instr_count>"${outdir}/main_fixedi_indep_fixedi_${count}.cpp" independent_with "${opening}" 'index_expr_fixed' "${count}" + # fixed_instr_count>"${outdir}/main_fixedi_dep_fixedi_${count}.cpp" dependent_with "${opening}" 'index_expr_fixed' "${count}" + + fixed_instr_var_count>"${outdir}/main_fixediv_indep_randi_${count}.cpp" independent_with "${opening}" 'index_expr_rand' "${count}" + fixed_instr_var_count>"${outdir}/main_fixediv_dep_randi_${count}.cpp" dependent_with "${opening}" 'index_expr_rand' "${count}" + fixed_instr_var_count>"${outdir}/main_fixediv_indep_fixedi_${count}.cpp" independent_with "${opening}" 'index_expr_fixed' "${count}" + fixed_instr_var_count>"${outdir}/main_fixediv_dep_fixedi_${count}.cpp" dependent_with "${opening}" 'index_expr_fixed' "${count}" +done diff --git a/ctbenchmarks/plot b/ctbenchmarks/plot new file mode 100755 index 0000000..ab0a923 --- /dev/null +++ b/ctbenchmarks/plot @@ -0,0 +1,121 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +import os, sys +sys.path.append(os.path.abspath(os.path.dirname(os.path.abspath(__file__))+"/../scripts")) + +import fileinput +import numpy as np +import matplotlib as mpl + +show = len(sys.argv) > 1 and sys.argv[1] == 'show' +if not show: + mpl.use('pgf') + +import matplotlib.pyplot as plt +import matplotlib.lines as lines +from common import set_size, config_plt, get_colors, fix_log_rects + +config_plt() + + +def toFloat(s): + return float(s.split(' ')[1].replace(',', '.')) + + +def loadData(fn): + content = [] + + with open(fn) as f: + content = f.readlines() + + values = {} + for line in content: + n, real, user, sys, _ = [x for x in line.split(':')] + time = toFloat(user) + toFloat(sys) + if not n in values: + values[n] = [] + values[n].append(time); + + if "5" in values: + values.pop("5") + + return values + + +def figCT(title, xlabel, xticks, output, datasrcs, legendOutside=False, error=False, log=False): + fig = plt.figure() + + plt.title(title) + plt.xlabel(xlabel) + plt.ylabel(u"temps (s)") + plt.xticks(xticks) + + if log: + plt.yscale('log') + + nd = len(datasrcs) + + width = 1.5 + pos = .5-.5*nd + for f, label in datasrcs: + values = loadData(f) + barcolor, errcolor = get_colors(['dep/fixed', 'indep/fixed', 'dep/rand', 'indep/rand'], label) + + for k, a in values.items(): + x = int(k) + m = np.mean(a) + s = 2.5758 * np.std(a) / np.sqrt(len(a)) + + x = x + pos*width + + bar = plt.bar(x, m, width=width, color=barcolor, label=label) + if log: + fix_log_rects(bar, 1e-4) + if error: + plt.errorbar(x, m, s, elinewidth=.8, capsize=1, ecolor=errcolor) + label='' + + pos = pos + 1 + + bbox=(1, 1) + if not legendOutside: + bbox=(.38, 1) + plt.legend(bbox_to_anchor=bbox) + + fig.set_size_inches(set_size(455.24408, .8)) + if not show: + plt.savefig(output, format='pdf', bbox_inches='tight') + return plt + + +# script +plts = [] + +plt = figCT(u"", u"nombre de boucles", [10, 20, 30, 40, 50, 60, 70, 80, 90, 100], + "plots/fixediv.pdf", [ + ['data/ct_fixediv_dep_fixedi', 'dep/fixed'], + ['data/ct_fixediv_indep_fixedi', 'indep/fixed'], + ['data/ct_fixediv_dep_randi', 'dep/rand'], + ['data/ct_fixediv_indep_randi', 'indep/rand'], + ], + legendOutside=True, + error=True + ) +plts.append(plt) + +plt = figCT(u"", u"nombre d'instructions", [10, 20, 30, 40, 50, 60, 70, 80, 90, 100], + "plots/fixedv.pdf", [ + ['data/ct_fixedv_dep_fixedi', 'dep/fixed'], + ['data/ct_fixedv_indep_fixedi', 'indep/fixed'], + ['data/ct_fixedv_dep_randi', 'dep/rand'], + ['data/ct_fixedv_indep_randi', 'indep/rand'], + ], + error=True, + log=True + ) +plts.append(plt) + +if show: + for plt in plts: + plt.show() diff --git a/ctbenchmarks/run_ct b/ctbenchmarks/run_ct new file mode 100755 index 0000000..2d52ecd --- /dev/null +++ b/ctbenchmarks/run_ct @@ -0,0 +1,15 @@ +#!/bin/bash + +repetitions=$1; shift +cxx=g++ + +for mode in $*; do + :>"data/ct_${mode}" + + for f in $(ls srcs|grep -E "^main_${mode}_[0-9]+.cpp"); do + n=$(echo ${f}|cut -d'_' -f5|cut -d'.' -f1) + for i in $(seq ${repetitions}); do + echo>>"data/ct_${mode}" "${n}:$( (time -p ${cxx} -O2 -pthread -I../src -o build/null "srcs/${f}") 2>&1|tr '\n' ':')" + done + done +done diff --git a/examples/basic.cpp b/examples/basic.cpp new file mode 100644 index 0000000..d987967 --- /dev/null +++ b/examples/basic.cpp @@ -0,0 +1,76 @@ +#include +#include +#include +#include + +#include +#include + +std::size_t pfor::ParallelForParameters::nThreads = 16; + +constexpr long n = 16; + +template +constexpr auto _ = pfor::ctv; + +#define OPERAND(T, ID) \ + T ID##_; \ + auto ID = pfor::Operand{ID##_} + +template +void printArray(std::array const& array) { + std::copy(std::begin(array), std::end(array), std::ostream_iterator(std::cout, " ")); + std::cout << std::endl; +} + +int main() { + using TypeA = std::array; OPERAND(TypeA, a); + using TypeB = std::array; OPERAND(TypeB, b); + using Type = std::array; OPERAND(Type, c); OPERAND(Type, d); + + std::generate_n(std::begin(a_), a_.size(), [i=0]() mutable { return i++; }); + std::generate_n(std::begin(b_), b_.size(), [i=0]() mutable { return n-i++; }); + std::generate_n(std::begin(c_), c_.size(), [i=0]() mutable { return 1+i++%3; }); + std::generate_n(std::begin(d_), d_.size(), [i=0]() mutable { return -i++; }); + + pfor::Index i; + + { + auto e = a[_<2>*i+_<1>] = a[_<2>*i]; + std::cout << "Is {a[2*i+1] = a[2*i]} parallelizable? " << std::boolalpha << parallelTest(pfor::Range{0,0}, e) << std::endl; + } + + { + auto e = a[i*i] = a[i*i]+1; + std::cout << "Is {a[i*i] = a[i*i]+1} parallelizable? " << std::boolalpha << parallelTest(pfor::Range{0,0}, e) << std::endl; + } + + { + auto e = a[injective(i*i)] = a[injective(i*i)]+1; + std::cout << "Is {a[injective(i*i)] = a[injective(i*i)]+1} parallelizable? " << std::boolalpha << parallelTest(pfor::Range{0,0}, e) << std::endl; + } + + { + auto e = a[i+_<1>] = a[i]; + std::cout << "Is {a[i+1] = a[i]}(step=1) parallelizable? " << std::boolalpha << parallelTest(pfor::RangeCT<0,1>{0}, e) << std::endl; + std::cout << "Is {a[i+1] = a[i]}(step=2) parallelizable? " << std::boolalpha << parallelTest(pfor::RangeCT<0,2>{0}, e) << std::endl; + } + + pfor::parallelFor(pfor::Range{0, n}, + d[i] = (xpr(i)+1)*a[i+_<1>], + b[_<2>*i+_<1>] = b[_<2>*i] + ); + + pfor::parallelFor(pfor::Range{0, static_cast(std::sqrt(n))}, + c[injective(i*i)] = c[injective(i*i)] + i + ); + + pfor::parallelFor(pfor::RangeCT<0,2>{n}, + a[i+_<1>] = a[i] + ); + + printArray(a_); + printArray(b_); + printArray(c_); + printArray(d_); +} diff --git a/examples/gen.cpp b/examples/gen.cpp new file mode 100644 index 0000000..108d553 --- /dev/null +++ b/examples/gen.cpp @@ -0,0 +1,58 @@ +#include +#include +#include +#include + +#include + +#define K 1 + +std::size_t pfor::ParallelForParameters::nThreads{1}; + +template +constexpr auto _ = pfor::ctv; + +using T = int; + +#define OPERAND(Type, name, size, filler) \ + Type * name##_ = new Type[size]; \ + { \ + std::size_t i = 0; \ + std::generate_n(name##_, size, [&i]{ return filler; }); \ + } \ + auto name = pfor::Operand(name##_); + +void printer(std::size_t) {} + +template +void printer(std::size_t n, T &&array, Ts&&... arrays) { + for(std::size_t i = 0; i < n; ++i) + std::clog << std::forward(array)[i] << ", "; + std::clog << std::endl; + printer(n, std::forward(arrays)...); +} + +int main() { + std::size_t const N = 1000000; + + OPERAND(T, a0, N, i++); + OPERAND(T, a1, N, i++); + OPERAND(T, a2, N, i++); + OPERAND(T, a3, N, i++); + OPERAND(T, a4, N, i++); + OPERAND(T, a5, N, i++); + OPERAND(T, a6, N, i++); + OPERAND(T, a7, N, i++); + + for(std::size_t k = 0; k < K; ++k) { + parallelFor(pfor::Range{0, N-1}, [&](pfor::Index i) { + return + a0[i] = a0[i+_<1>] + a1[i] * a2[i], + a1[i] = a1[i+_<1>] + a2[i] * a3[i], + a2[i] = a2[i+_<1>] + a3[i] * a4[i], + a5[i] = a5[i+_<1>] + a6[i] * a7[i]; + }); + } + + printer(N, a0_, a1_, a2_, a3_, a4_, a5_, a6_, a7_); +} diff --git a/examples/operand.cpp b/examples/operand.cpp new file mode 100644 index 0000000..7c4ef2b --- /dev/null +++ b/examples/operand.cpp @@ -0,0 +1,74 @@ +#include +#include +#include + +#include + +#define N 10 +#define DELAY 10'000'000 + +#define WAIT(DELAY) \ + for(std::size_t i = 0; i < DELAY; ++i) + +template +constexpr auto _ = pfor::ctv; + +std::size_t pfor::ParallelForParameters::nThreads = 4; + +/* slow operator+ */ +template +class Foo { + T data; + +public: + Foo() = default; + Foo(T const&data): data{data} {} + + Foo &operator=(T const&data) { + WAIT(DELAY); + this->data = data; + return *this; + } + + Foo operator+(Foo const&o) { + WAIT(DELAY); + return Foo{data+o.data}; + } + + operator T() const { return data; } +}; + +int main() { + Foo<> a[N+1], b[N], c[N], d[N]; + int t[N]; + + { int i = 0; std::generate_n(std::begin(a), N+1, [&i]{ return N-(i++); }); } + { int i = 0; std::generate_n(std::begin(b), N, [&i]{ return i++; }); } + { std::generate_n(std::begin(c), N, []{ return 250; }); } + { int i = 0; std::generate_n(std::begin(d), N, [&i]{ return i++&1; }); } + + pfor::parallelFor(pfor::Range{0, N-1}, + [ + a=pfor::Operand*, class IDa>(a), + b=pfor::Operand*, class IDb>(b), + c=pfor::Operand*, class IDc>(c), + d=pfor::Operand*, class IDd>(d), + t=pfor::expr::Constant(t) + ] (auto i) mutable { + return ( + a[i] = b[i]+a[i+_<1>], + c[i] = c[i]+c[i], + b[i] = 3 + ); + } + ); + + std::copy(a, a+N, std::ostream_iterator(std::cout, " ")); + std::cout << std::endl; + std::copy(b, b+N, std::ostream_iterator(std::cout, " ")); + std::cout << std::endl; + std::copy(c, c+N, std::ostream_iterator(std::cout, " ")); + std::cout << std::endl; + std::copy(d, d+N, std::ostream_iterator(std::cout, " ")); + std::cout << std::endl; +} diff --git a/examples/properties.cpp b/examples/properties.cpp new file mode 100644 index 0000000..ccaa8b8 --- /dev/null +++ b/examples/properties.cpp @@ -0,0 +1,47 @@ +#include +#include +#include + +int main() { + std::array a; + pfor::Operand, void> o{a}; + pfor::Index i; + + auto strinc = strictinc(i*i); + auto strdec = strictdec(i*i); + + { + auto e = o[strinc] = o[strinc]+1; + std::cout << "strictly inc: " << std::boolalpha << parallelTest(pfor::Range{0,0}, e) << std::endl; + } + { + auto ii = strinc + strinc; + auto e = o[ii] = o[ii]+1; + std::cout << "strictly inc + strictly inc: " << std::boolalpha << parallelTest(pfor::Range{0,0}, e) << std::endl; + } + { + auto ii = strinc + strdec; + auto e = o[ii] = o[ii]+1; + std::cout << "strictly inc + strictly dec: " << std::boolalpha << parallelTest(pfor::Range{0,0}, e) << std::endl; + } + { + auto ii = strdec + strinc; + auto e = o[ii] = o[ii]+1; + std::cout << "strictly dec + strictly inc: " << std::boolalpha << parallelTest(pfor::Range{0,0}, e) << std::endl; + } + { + auto ii = strdec + strdec; + auto e = o[ii] = o[ii]+1; + std::cout << "strictly dec + strictly dec: " << std::boolalpha << parallelTest(pfor::Range{0,0}, e) << std::endl; + } + { + auto ii = strinc - strdec; + auto e = o[ii] = o[ii]+1; + std::cout << "strictly inc - strictly dec: " << std::boolalpha << parallelTest(pfor::Range{0,0}, e) << std::endl; + } + { + auto ii = strdec - strinc; + auto e = o[ii] = o[ii]+1; + std::cout << "strictly dec - strictly inc: " << std::boolalpha << parallelTest(pfor::Range{0,0}, e) << std::endl; + } +} diff --git a/examples/seq.cpp b/examples/seq.cpp new file mode 100644 index 0000000..8976f55 --- /dev/null +++ b/examples/seq.cpp @@ -0,0 +1,52 @@ +#include +#include +#include + +#include + +#define K 1 + +std::size_t pfor::ParallelForParameters::nThreads{1}; + +using T = int; + +#define OPERAND(Type, name, n, size, filler) \ + Type * name##n##_ = new Type[size]; \ + { \ + std::size_t i = 0; \ + std::generate_n(name##n##_, size, [&i]{ return filler; }); \ + } + +void printer(std::size_t) {} + +template +void printer(std::size_t n, T &&array, Ts&&... arrays) { + for(std::size_t i = 0; i < n; ++i) + std::clog << std::forward(array)[i] << ", "; + std::clog << std::endl; + printer(n, std::forward(arrays)...); +} + +int main() { + std::size_t const N = 1000000; + + OPERAND(T, a, 0, N, i++); + OPERAND(T, a, 1, N, i++); + OPERAND(T, a, 2, N, i++); + OPERAND(T, a, 3, N, i++); + OPERAND(T, a, 4, N, i++); + OPERAND(T, a, 5, N, i++); + OPERAND(T, a, 6, N, i++); + OPERAND(T, a, 7, N, i++); + + for(std::size_t k = 0; k < K; ++k) { + for(std::size_t i = 0; i < N-1; ++i) { + a0_[i] = a0_[i+1] + a1_[i] * a2_[i]; + a1_[i] = a1_[i+1] + a2_[i] * a3_[i]; + a2_[i] = a2_[i+1] + a3_[i] * a4_[i]; + a5_[i] = a5_[i+1] + a6_[i] * a7_[i]; + } + } + + printer(N, a0_, a1_, a2_, a3_, a4_, a5_, a6_, a7_); +} diff --git a/examples/thesis.cpp b/examples/thesis.cpp new file mode 100644 index 0000000..a95ead3 --- /dev/null +++ b/examples/thesis.cpp @@ -0,0 +1,27 @@ +#include +#include +#include + +std::size_t pfor::ParallelForParameters::nThreads = 16; + +constexpr long n = 16; + +int main() { + std::array a_; pfor::Operand a{a_}; + std::array b_; pfor::Operand b{b_}; + std::array c_; pfor::Operand c{c_}; + std::array d_; pfor::Operand d{d_}; + std::array e_; pfor::Operand e{e_}; + std::array f_; pfor::Operand f{f_}; + + auto pow = pfor::makeOperator(std::pow); + + pfor::Index i; + pfor::parallelFor(pfor::Range{0, static_cast(std::sqrt(n))}, + a[i] = a[i] * b[i], + c[i] = c[i+pfor::ctv<1>] - d[i], + b[i] = b[i] + i, + d[i] = pow(c[i], e[i]), + f[injective(i*i)] = 2 * f[injective(i*i)] + ); +} diff --git a/examples/types.cpp b/examples/types.cpp new file mode 100644 index 0000000..92969a5 --- /dev/null +++ b/examples/types.cpp @@ -0,0 +1,48 @@ +#include +#include +#include + +#include + +#define N 10 + +template +void printTypes(Ts...) { + std::puts(__PRETTY_FUNCTION__); +} + +int main() { + int dummy[N+1]; + auto a = pfor::Operand(dummy); + auto b = pfor::Operand(dummy); + auto c = pfor::Operand(dummy); + auto d = pfor::Operand(dummy); + auto e = pfor::Operand(dummy); + auto f = pfor::Operand(dummy); + + pfor::Index i; + auto expr = + ( + a[i] = a[i] * b[i], + c[i] = c[i+pfor::ctv<1>] + d[i], + b[i] = b[i] + 1, + d[i] = c[i]^e[i], + f[i] = 2 * f[i] + ); + + using CommaSplittedExpr = pfor::expr::SplitComma; + using ExprInfo = pfor::expr::ExpressionInfo; + using Clusters = typename pfor::impl::ClustersGenImpl, ExprInfo>::type; + using ClustersIds = pfor::ClustersExpressionIds; + using Type = pfor::PackSort; + + printTypes(expr); + std::puts("--"); + printTypes(); + std::puts("--"); + printTypes(); + std::puts("--"); + printTypes(); + std::puts("--"); + printTypes(); +} diff --git a/examples/unrolling.cpp b/examples/unrolling.cpp new file mode 100644 index 0000000..8511975 --- /dev/null +++ b/examples/unrolling.cpp @@ -0,0 +1,33 @@ +#include +#include +#include + +#include +#include + +constexpr long n = 10; + +#define OPERAND(T, ID) \ + T ID##_; \ + auto ID = pfor::Operand{ID##_} + +template +void printArray(std::array const& array) { + std::copy(std::begin(array), std::end(array), std::ostream_iterator(std::cout, " ")); + std::cout << std::endl; +} + +int main() { + using Type = std::array; + OPERAND(Type, a); + + std::generate_n(std::begin(a_), n, [i=1]() mutable { return i++; }); + + pfor::Index i; + + pfor::parallelFor::template Template>(pfor::Range{0, n}, + a[i] = 3*a[i] + ); + + printArray(a_); +} diff --git a/examples/userops.cpp b/examples/userops.cpp new file mode 100644 index 0000000..413c9df --- /dev/null +++ b/examples/userops.cpp @@ -0,0 +1,56 @@ +#include +#include +#include +#include + +#include + +constexpr long n = 10; + +template +constexpr auto _ = pfor::ctv; + +#define OPERAND(T, ID) \ + T ID##_; \ + auto ID = pfor::Operand{ID##_} + +template +void printArray(std::array const& array) { + std::copy(std::begin(array), std::end(array), std::ostream_iterator(std::cout, " ")); + std::cout << std::endl; +} + +inline static long long factorial(long long n) { + long long r = 1; + while(n > 1) r *= n--; + return r; +} + +std::size_t pfor::ParallelForParameters::nThreads = 4; + +int main() { + using Type = std::array; + OPERAND(Type, a); OPERAND(Type, b); OPERAND(Type, c); OPERAND(Type, d); + + std::generate_n(std::begin(a_), n, [i=0]() mutable { return i++; }); + std::generate_n(std::begin(b_), n, [i=0]() mutable { return n-i++; }); + std::generate_n(std::begin(c_), n, [i=0]() mutable { return i++%3; }); + std::generate_n(std::begin(d_), n, [i=0]() mutable { return -i++; }); + + pfor::Index i; + + auto add3 = pfor::makeOperator([](auto a, auto b, auto c) { return a+b+c; }); + auto pow = pfor::makeOperator(std::pow); + auto factorial = pfor::makeOperator(::factorial); + + pfor::parallelFor(pfor::Range{0, n}, + a[i] = add3(a[i], c[i], c[i]), + b[i] = pow(b[i], c[i]), + d[i] = pow(factorial(-d[i]/2), xpr(i) % 4 + 1) + ); + + printArray(a_); + printArray(b_); + printArray(c_); + printArray(d_); +} diff --git a/inc/catch.hpp b/inc/catch.hpp new file mode 100644 index 0000000..4d1fc33 --- /dev/null +++ b/inc/catch.hpp @@ -0,0 +1,11606 @@ +/* + * Catch v1.10.0 + * Generated: 2017-08-26 15:16:46.676990 + * ---------------------------------------------------------- + * This file has been merged from multiple headers. Please don't edit it directly + * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. + * + * Distributed under the Boost Software License, Version 1.0. (See accompanying + * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + */ +#ifndef TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED +#define TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED + +#define TWOBLUECUBES_CATCH_HPP_INCLUDED + +#ifdef __clang__ +# pragma clang system_header +#elif defined __GNUC__ +# pragma GCC system_header +#endif + +// #included from: internal/catch_suppress_warnings.h + +#ifdef __clang__ +# ifdef __ICC // icpc defines the __clang__ macro +# pragma warning(push) +# pragma warning(disable: 161 1682) +# else // __ICC +# pragma clang diagnostic ignored "-Wglobal-constructors" +# pragma clang diagnostic ignored "-Wvariadic-macros" +# pragma clang diagnostic ignored "-Wc99-extensions" +# pragma clang diagnostic ignored "-Wunused-variable" +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wpadded" +# pragma clang diagnostic ignored "-Wc++98-compat" +# pragma clang diagnostic ignored "-Wc++98-compat-pedantic" +# pragma clang diagnostic ignored "-Wswitch-enum" +# pragma clang diagnostic ignored "-Wcovered-switch-default" +# endif +#elif defined __GNUC__ +# pragma GCC diagnostic ignored "-Wvariadic-macros" +# pragma GCC diagnostic ignored "-Wunused-variable" +# pragma GCC diagnostic ignored "-Wparentheses" + +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wpadded" +#endif +#if defined(CATCH_CONFIG_MAIN) || defined(CATCH_CONFIG_RUNNER) +# define CATCH_IMPL +#endif + +#ifdef CATCH_IMPL +# ifndef CLARA_CONFIG_MAIN +# define CLARA_CONFIG_MAIN_NOT_DEFINED +# define CLARA_CONFIG_MAIN +# endif +#endif + +// #included from: internal/catch_notimplemented_exception.h +#define TWOBLUECUBES_CATCH_NOTIMPLEMENTED_EXCEPTION_H_INCLUDED + +// #included from: catch_common.h +#define TWOBLUECUBES_CATCH_COMMON_H_INCLUDED + +// #included from: catch_compiler_capabilities.h +#define TWOBLUECUBES_CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED + +// Detect a number of compiler features - mostly C++11/14 conformance - by compiler +// The following features are defined: +// +// CATCH_CONFIG_CPP11_NULLPTR : is nullptr supported? +// CATCH_CONFIG_CPP11_NOEXCEPT : is noexcept supported? +// CATCH_CONFIG_CPP11_GENERATED_METHODS : The delete and default keywords for compiler generated methods +// CATCH_CONFIG_CPP11_IS_ENUM : std::is_enum is supported? +// CATCH_CONFIG_CPP11_TUPLE : std::tuple is supported +// CATCH_CONFIG_CPP11_LONG_LONG : is long long supported? +// CATCH_CONFIG_CPP11_OVERRIDE : is override supported? +// CATCH_CONFIG_CPP11_UNIQUE_PTR : is unique_ptr supported (otherwise use auto_ptr) +// CATCH_CONFIG_CPP11_SHUFFLE : is std::shuffle supported? +// CATCH_CONFIG_CPP11_TYPE_TRAITS : are type_traits and enable_if supported? + +// CATCH_CONFIG_CPP11_OR_GREATER : Is C++11 supported? + +// CATCH_CONFIG_VARIADIC_MACROS : are variadic macros supported? +// CATCH_CONFIG_COUNTER : is the __COUNTER__ macro supported? +// CATCH_CONFIG_WINDOWS_SEH : is Windows SEH supported? +// CATCH_CONFIG_POSIX_SIGNALS : are POSIX signals supported? +// **************** +// Note to maintainers: if new toggles are added please document them +// in configuration.md, too +// **************** + +// In general each macro has a _NO_ form +// (e.g. CATCH_CONFIG_CPP11_NO_NULLPTR) which disables the feature. +// Many features, at point of detection, define an _INTERNAL_ macro, so they +// can be combined, en-mass, with the _NO_ forms later. + +// All the C++11 features can be disabled with CATCH_CONFIG_NO_CPP11 + +#ifdef __cplusplus + +# if __cplusplus >= 201103L +# define CATCH_CPP11_OR_GREATER +# endif + +# if __cplusplus >= 201402L +# define CATCH_CPP14_OR_GREATER +# endif + +#endif + +#ifdef __clang__ + +# if __has_feature(cxx_nullptr) +# define CATCH_INTERNAL_CONFIG_CPP11_NULLPTR +# endif + +# if __has_feature(cxx_noexcept) +# define CATCH_INTERNAL_CONFIG_CPP11_NOEXCEPT +# endif + +# if defined(CATCH_CPP11_OR_GREATER) +# define CATCH_INTERNAL_SUPPRESS_ETD_WARNINGS \ + _Pragma( "clang diagnostic push" ) \ + _Pragma( "clang diagnostic ignored \"-Wexit-time-destructors\"" ) +# define CATCH_INTERNAL_UNSUPPRESS_ETD_WARNINGS \ + _Pragma( "clang diagnostic pop" ) + +# define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \ + _Pragma( "clang diagnostic push" ) \ + _Pragma( "clang diagnostic ignored \"-Wparentheses\"" ) +# define CATCH_INTERNAL_UNSUPPRESS_PARENTHESES_WARNINGS \ + _Pragma( "clang diagnostic pop" ) +# endif + +#endif // __clang__ + +//////////////////////////////////////////////////////////////////////////////// +// We know some environments not to support full POSIX signals +#if defined(__CYGWIN__) || defined(__QNX__) + +# if !defined(CATCH_CONFIG_POSIX_SIGNALS) +# define CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS +# endif + +#endif + +#ifdef __OS400__ +# define CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS +# define CATCH_CONFIG_COLOUR_NONE +#endif + +//////////////////////////////////////////////////////////////////////////////// +// Cygwin +#ifdef __CYGWIN__ + +// Required for some versions of Cygwin to declare gettimeofday +// see: http://stackoverflow.com/questions/36901803/gettimeofday-not-declared-in-this-scope-cygwin +# define _BSD_SOURCE + +#endif // __CYGWIN__ + +//////////////////////////////////////////////////////////////////////////////// +// Borland +#ifdef __BORLANDC__ + +#endif // __BORLANDC__ + +//////////////////////////////////////////////////////////////////////////////// +// EDG +#ifdef __EDG_VERSION__ + +#endif // __EDG_VERSION__ + +//////////////////////////////////////////////////////////////////////////////// +// Digital Mars +#ifdef __DMC__ + +#endif // __DMC__ + +//////////////////////////////////////////////////////////////////////////////// +// GCC +#ifdef __GNUC__ + +# if __GNUC__ == 4 && __GNUC_MINOR__ >= 6 && defined(__GXX_EXPERIMENTAL_CXX0X__) +# define CATCH_INTERNAL_CONFIG_CPP11_NULLPTR +# endif + +// - otherwise more recent versions define __cplusplus >= 201103L +// and will get picked up below + +#endif // __GNUC__ + +//////////////////////////////////////////////////////////////////////////////// +// Visual C++ +#ifdef _MSC_VER + +#define CATCH_INTERNAL_CONFIG_WINDOWS_SEH + +#if (_MSC_VER >= 1600) +# define CATCH_INTERNAL_CONFIG_CPP11_NULLPTR +# define CATCH_INTERNAL_CONFIG_CPP11_UNIQUE_PTR +#endif + +#if (_MSC_VER >= 1900 ) // (VC++ 13 (VS2015)) +#define CATCH_INTERNAL_CONFIG_CPP11_NOEXCEPT +#define CATCH_INTERNAL_CONFIG_CPP11_GENERATED_METHODS +#define CATCH_INTERNAL_CONFIG_CPP11_SHUFFLE +#define CATCH_INTERNAL_CONFIG_CPP11_TYPE_TRAITS +#endif + +#endif // _MSC_VER + +//////////////////////////////////////////////////////////////////////////////// + +// Use variadic macros if the compiler supports them +#if ( defined _MSC_VER && _MSC_VER > 1400 && !defined __EDGE__) || \ + ( defined __WAVE__ && __WAVE_HAS_VARIADICS ) || \ + ( defined __GNUC__ && __GNUC__ >= 3 ) || \ + ( !defined __cplusplus && __STDC_VERSION__ >= 199901L || __cplusplus >= 201103L ) + +#define CATCH_INTERNAL_CONFIG_VARIADIC_MACROS + +#endif + +// Use __COUNTER__ if the compiler supports it +#if ( defined _MSC_VER && _MSC_VER >= 1300 ) || \ + ( defined __GNUC__ && ( __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3 )) ) || \ + ( defined __clang__ && __clang_major__ >= 3 ) + +#define CATCH_INTERNAL_CONFIG_COUNTER + +#endif + +//////////////////////////////////////////////////////////////////////////////// +// C++ language feature support + +// catch all support for C++11 +#if defined(CATCH_CPP11_OR_GREATER) + +# if !defined(CATCH_INTERNAL_CONFIG_CPP11_NULLPTR) +# define CATCH_INTERNAL_CONFIG_CPP11_NULLPTR +# endif + +# ifndef CATCH_INTERNAL_CONFIG_CPP11_NOEXCEPT +# define CATCH_INTERNAL_CONFIG_CPP11_NOEXCEPT +# endif + +# ifndef CATCH_INTERNAL_CONFIG_CPP11_GENERATED_METHODS +# define CATCH_INTERNAL_CONFIG_CPP11_GENERATED_METHODS +# endif + +# ifndef CATCH_INTERNAL_CONFIG_CPP11_IS_ENUM +# define CATCH_INTERNAL_CONFIG_CPP11_IS_ENUM +# endif + +# ifndef CATCH_INTERNAL_CONFIG_CPP11_TUPLE +# define CATCH_INTERNAL_CONFIG_CPP11_TUPLE +# endif + +# ifndef CATCH_INTERNAL_CONFIG_VARIADIC_MACROS +# define CATCH_INTERNAL_CONFIG_VARIADIC_MACROS +# endif + +# if !defined(CATCH_INTERNAL_CONFIG_CPP11_LONG_LONG) +# define CATCH_INTERNAL_CONFIG_CPP11_LONG_LONG +# endif + +# if !defined(CATCH_INTERNAL_CONFIG_CPP11_OVERRIDE) +# define CATCH_INTERNAL_CONFIG_CPP11_OVERRIDE +# endif +# if !defined(CATCH_INTERNAL_CONFIG_CPP11_UNIQUE_PTR) +# define CATCH_INTERNAL_CONFIG_CPP11_UNIQUE_PTR +# endif +# if !defined(CATCH_INTERNAL_CONFIG_CPP11_SHUFFLE) +# define CATCH_INTERNAL_CONFIG_CPP11_SHUFFLE +# endif +# if !defined(CATCH_INTERNAL_CONFIG_CPP11_TYPE_TRAITS) +# define CATCH_INTERNAL_CONFIG_CPP11_TYPE_TRAITS +# endif + +#endif // __cplusplus >= 201103L + +// Now set the actual defines based on the above + anything the user has configured +#if defined(CATCH_INTERNAL_CONFIG_CPP11_NULLPTR) && !defined(CATCH_CONFIG_CPP11_NO_NULLPTR) && !defined(CATCH_CONFIG_CPP11_NULLPTR) && !defined(CATCH_CONFIG_NO_CPP11) +# define CATCH_CONFIG_CPP11_NULLPTR +#endif +#if defined(CATCH_INTERNAL_CONFIG_CPP11_NOEXCEPT) && !defined(CATCH_CONFIG_CPP11_NO_NOEXCEPT) && !defined(CATCH_CONFIG_CPP11_NOEXCEPT) && !defined(CATCH_CONFIG_NO_CPP11) +# define CATCH_CONFIG_CPP11_NOEXCEPT +#endif +#if defined(CATCH_INTERNAL_CONFIG_CPP11_GENERATED_METHODS) && !defined(CATCH_CONFIG_CPP11_NO_GENERATED_METHODS) && !defined(CATCH_CONFIG_CPP11_GENERATED_METHODS) && !defined(CATCH_CONFIG_NO_CPP11) +# define CATCH_CONFIG_CPP11_GENERATED_METHODS +#endif +#if defined(CATCH_INTERNAL_CONFIG_CPP11_IS_ENUM) && !defined(CATCH_CONFIG_CPP11_NO_IS_ENUM) && !defined(CATCH_CONFIG_CPP11_IS_ENUM) && !defined(CATCH_CONFIG_NO_CPP11) +# define CATCH_CONFIG_CPP11_IS_ENUM +#endif +#if defined(CATCH_INTERNAL_CONFIG_CPP11_TUPLE) && !defined(CATCH_CONFIG_CPP11_NO_TUPLE) && !defined(CATCH_CONFIG_CPP11_TUPLE) && !defined(CATCH_CONFIG_NO_CPP11) +# define CATCH_CONFIG_CPP11_TUPLE +#endif +#if defined(CATCH_INTERNAL_CONFIG_VARIADIC_MACROS) && !defined(CATCH_CONFIG_NO_VARIADIC_MACROS) && !defined(CATCH_CONFIG_VARIADIC_MACROS) +# define CATCH_CONFIG_VARIADIC_MACROS +#endif +#if defined(CATCH_INTERNAL_CONFIG_CPP11_LONG_LONG) && !defined(CATCH_CONFIG_CPP11_NO_LONG_LONG) && !defined(CATCH_CONFIG_CPP11_LONG_LONG) && !defined(CATCH_CONFIG_NO_CPP11) +# define CATCH_CONFIG_CPP11_LONG_LONG +#endif +#if defined(CATCH_INTERNAL_CONFIG_CPP11_OVERRIDE) && !defined(CATCH_CONFIG_CPP11_NO_OVERRIDE) && !defined(CATCH_CONFIG_CPP11_OVERRIDE) && !defined(CATCH_CONFIG_NO_CPP11) +# define CATCH_CONFIG_CPP11_OVERRIDE +#endif +#if defined(CATCH_INTERNAL_CONFIG_CPP11_UNIQUE_PTR) && !defined(CATCH_CONFIG_CPP11_NO_UNIQUE_PTR) && !defined(CATCH_CONFIG_CPP11_UNIQUE_PTR) && !defined(CATCH_CONFIG_NO_CPP11) +# define CATCH_CONFIG_CPP11_UNIQUE_PTR +#endif +// Use of __COUNTER__ is suppressed if __JETBRAINS_IDE__ is #defined (meaning we're being parsed by a JetBrains IDE for +// analytics) because, at time of writing, __COUNTER__ is not properly handled by it. +// This does not affect compilation +#if defined(CATCH_INTERNAL_CONFIG_COUNTER) && !defined(CATCH_CONFIG_NO_COUNTER) && !defined(CATCH_CONFIG_COUNTER) && !defined(__JETBRAINS_IDE__) +# define CATCH_CONFIG_COUNTER +#endif +#if defined(CATCH_INTERNAL_CONFIG_CPP11_SHUFFLE) && !defined(CATCH_CONFIG_CPP11_NO_SHUFFLE) && !defined(CATCH_CONFIG_CPP11_SHUFFLE) && !defined(CATCH_CONFIG_NO_CPP11) +# define CATCH_CONFIG_CPP11_SHUFFLE +#endif +# if defined(CATCH_INTERNAL_CONFIG_CPP11_TYPE_TRAITS) && !defined(CATCH_CONFIG_CPP11_NO_TYPE_TRAITS) && !defined(CATCH_CONFIG_CPP11_TYPE_TRAITS) && !defined(CATCH_CONFIG_NO_CPP11) +# define CATCH_CONFIG_CPP11_TYPE_TRAITS +# endif +#if defined(CATCH_INTERNAL_CONFIG_WINDOWS_SEH) && !defined(CATCH_CONFIG_NO_WINDOWS_SEH) && !defined(CATCH_CONFIG_WINDOWS_SEH) +# define CATCH_CONFIG_WINDOWS_SEH +#endif +// This is set by default, because we assume that unix compilers are posix-signal-compatible by default. +#if !defined(CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS) && !defined(CATCH_CONFIG_NO_POSIX_SIGNALS) && !defined(CATCH_CONFIG_POSIX_SIGNALS) +# define CATCH_CONFIG_POSIX_SIGNALS +#endif + +#if !defined(CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS) +# define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS +# define CATCH_INTERNAL_UNSUPPRESS_PARENTHESES_WARNINGS +#endif +#if !defined(CATCH_INTERNAL_SUPPRESS_ETD_WARNINGS) +# define CATCH_INTERNAL_SUPPRESS_ETD_WARNINGS +# define CATCH_INTERNAL_UNSUPPRESS_ETD_WARNINGS +#endif + +// noexcept support: +#if defined(CATCH_CONFIG_CPP11_NOEXCEPT) && !defined(CATCH_NOEXCEPT) +# define CATCH_NOEXCEPT noexcept +# define CATCH_NOEXCEPT_IS(x) noexcept(x) +#else +# define CATCH_NOEXCEPT throw() +# define CATCH_NOEXCEPT_IS(x) +#endif + +// nullptr support +#ifdef CATCH_CONFIG_CPP11_NULLPTR +# define CATCH_NULL nullptr +#else +# define CATCH_NULL NULL +#endif + +// override support +#ifdef CATCH_CONFIG_CPP11_OVERRIDE +# define CATCH_OVERRIDE override +#else +# define CATCH_OVERRIDE +#endif + +// unique_ptr support +#ifdef CATCH_CONFIG_CPP11_UNIQUE_PTR +# define CATCH_AUTO_PTR( T ) std::unique_ptr +#else +# define CATCH_AUTO_PTR( T ) std::auto_ptr +#endif + +#define INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line ) name##line +#define INTERNAL_CATCH_UNIQUE_NAME_LINE( name, line ) INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line ) +#ifdef CATCH_CONFIG_COUNTER +# define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __COUNTER__ ) +#else +# define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __LINE__ ) +#endif + +#define INTERNAL_CATCH_STRINGIFY2( expr ) #expr +#define INTERNAL_CATCH_STRINGIFY( expr ) INTERNAL_CATCH_STRINGIFY2( expr ) + +#include +#include + +namespace Catch { + + struct IConfig; + + struct CaseSensitive { enum Choice { + Yes, + No + }; }; + + class NonCopyable { +#ifdef CATCH_CONFIG_CPP11_GENERATED_METHODS + NonCopyable( NonCopyable const& ) = delete; + NonCopyable( NonCopyable && ) = delete; + NonCopyable& operator = ( NonCopyable const& ) = delete; + NonCopyable& operator = ( NonCopyable && ) = delete; +#else + NonCopyable( NonCopyable const& info ); + NonCopyable& operator = ( NonCopyable const& ); +#endif + + protected: + NonCopyable() {} + virtual ~NonCopyable(); + }; + + class SafeBool { + public: + typedef void (SafeBool::*type)() const; + + static type makeSafe( bool value ) { + return value ? &SafeBool::trueValue : 0; + } + private: + void trueValue() const {} + }; + + template + void deleteAll( ContainerT& container ) { + typename ContainerT::const_iterator it = container.begin(); + typename ContainerT::const_iterator itEnd = container.end(); + for(; it != itEnd; ++it ) + delete *it; + } + template + void deleteAllValues( AssociativeContainerT& container ) { + typename AssociativeContainerT::const_iterator it = container.begin(); + typename AssociativeContainerT::const_iterator itEnd = container.end(); + for(; it != itEnd; ++it ) + delete it->second; + } + + bool startsWith( std::string const& s, std::string const& prefix ); + bool startsWith( std::string const& s, char prefix ); + bool endsWith( std::string const& s, std::string const& suffix ); + bool endsWith( std::string const& s, char suffix ); + bool contains( std::string const& s, std::string const& infix ); + void toLowerInPlace( std::string& s ); + std::string toLower( std::string const& s ); + std::string trim( std::string const& str ); + bool replaceInPlace( std::string& str, std::string const& replaceThis, std::string const& withThis ); + + struct pluralise { + pluralise( std::size_t count, std::string const& label ); + + friend std::ostream& operator << ( std::ostream& os, pluralise const& pluraliser ); + + std::size_t m_count; + std::string m_label; + }; + + struct SourceLineInfo { + + SourceLineInfo(); + SourceLineInfo( char const* _file, std::size_t _line ); +# ifdef CATCH_CONFIG_CPP11_GENERATED_METHODS + SourceLineInfo(SourceLineInfo const& other) = default; + SourceLineInfo( SourceLineInfo && ) = default; + SourceLineInfo& operator = ( SourceLineInfo const& ) = default; + SourceLineInfo& operator = ( SourceLineInfo && ) = default; +# endif + bool empty() const; + bool operator == ( SourceLineInfo const& other ) const; + bool operator < ( SourceLineInfo const& other ) const; + + char const* file; + std::size_t line; + }; + + std::ostream& operator << ( std::ostream& os, SourceLineInfo const& info ); + + // This is just here to avoid compiler warnings with macro constants and boolean literals + inline bool isTrue( bool value ){ return value; } + inline bool alwaysTrue() { return true; } + inline bool alwaysFalse() { return false; } + + void throwLogicError( std::string const& message, SourceLineInfo const& locationInfo ); + + void seedRng( IConfig const& config ); + unsigned int rngSeed(); + + // Use this in variadic streaming macros to allow + // >> +StreamEndStop + // as well as + // >> stuff +StreamEndStop + struct StreamEndStop { + std::string operator+() { + return std::string(); + } + }; + template + T const& operator + ( T const& value, StreamEndStop ) { + return value; + } +} + +#define CATCH_INTERNAL_LINEINFO ::Catch::SourceLineInfo( __FILE__, static_cast( __LINE__ ) ) +#define CATCH_INTERNAL_ERROR( msg ) ::Catch::throwLogicError( msg, CATCH_INTERNAL_LINEINFO ); + +namespace Catch { + + class NotImplementedException : public std::exception + { + public: + NotImplementedException( SourceLineInfo const& lineInfo ); + + virtual ~NotImplementedException() CATCH_NOEXCEPT {} + + virtual const char* what() const CATCH_NOEXCEPT; + + private: + std::string m_what; + SourceLineInfo m_lineInfo; + }; + +} // end namespace Catch + +/////////////////////////////////////////////////////////////////////////////// +#define CATCH_NOT_IMPLEMENTED throw Catch::NotImplementedException( CATCH_INTERNAL_LINEINFO ) + +// #included from: internal/catch_context.h +#define TWOBLUECUBES_CATCH_CONTEXT_H_INCLUDED + +// #included from: catch_interfaces_generators.h +#define TWOBLUECUBES_CATCH_INTERFACES_GENERATORS_H_INCLUDED + +#include + +namespace Catch { + + struct IGeneratorInfo { + virtual ~IGeneratorInfo(); + virtual bool moveNext() = 0; + virtual std::size_t getCurrentIndex() const = 0; + }; + + struct IGeneratorsForTest { + virtual ~IGeneratorsForTest(); + + virtual IGeneratorInfo& getGeneratorInfo( std::string const& fileInfo, std::size_t size ) = 0; + virtual bool moveNext() = 0; + }; + + IGeneratorsForTest* createGeneratorsForTest(); + +} // end namespace Catch + +// #included from: catch_ptr.hpp +#define TWOBLUECUBES_CATCH_PTR_HPP_INCLUDED + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wpadded" +#endif + +namespace Catch { + + // An intrusive reference counting smart pointer. + // T must implement addRef() and release() methods + // typically implementing the IShared interface + template + class Ptr { + public: + Ptr() : m_p( CATCH_NULL ){} + Ptr( T* p ) : m_p( p ){ + if( m_p ) + m_p->addRef(); + } + Ptr( Ptr const& other ) : m_p( other.m_p ){ + if( m_p ) + m_p->addRef(); + } + ~Ptr(){ + if( m_p ) + m_p->release(); + } + void reset() { + if( m_p ) + m_p->release(); + m_p = CATCH_NULL; + } + Ptr& operator = ( T* p ){ + Ptr temp( p ); + swap( temp ); + return *this; + } + Ptr& operator = ( Ptr const& other ){ + Ptr temp( other ); + swap( temp ); + return *this; + } + void swap( Ptr& other ) { std::swap( m_p, other.m_p ); } + T* get() const{ return m_p; } + T& operator*() const { return *m_p; } + T* operator->() const { return m_p; } + bool operator !() const { return m_p == CATCH_NULL; } + operator SafeBool::type() const { return SafeBool::makeSafe( m_p != CATCH_NULL ); } + + private: + T* m_p; + }; + + struct IShared : NonCopyable { + virtual ~IShared(); + virtual void addRef() const = 0; + virtual void release() const = 0; + }; + + template + struct SharedImpl : T { + + SharedImpl() : m_rc( 0 ){} + + virtual void addRef() const { + ++m_rc; + } + virtual void release() const { + if( --m_rc == 0 ) + delete this; + } + + mutable unsigned int m_rc; + }; + +} // end namespace Catch + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + +namespace Catch { + + class TestCase; + class Stream; + struct IResultCapture; + struct IRunner; + struct IGeneratorsForTest; + struct IConfig; + + struct IContext + { + virtual ~IContext(); + + virtual IResultCapture* getResultCapture() = 0; + virtual IRunner* getRunner() = 0; + virtual size_t getGeneratorIndex( std::string const& fileInfo, size_t totalSize ) = 0; + virtual bool advanceGeneratorsForCurrentTest() = 0; + virtual Ptr getConfig() const = 0; + }; + + struct IMutableContext : IContext + { + virtual ~IMutableContext(); + virtual void setResultCapture( IResultCapture* resultCapture ) = 0; + virtual void setRunner( IRunner* runner ) = 0; + virtual void setConfig( Ptr const& config ) = 0; + }; + + IContext& getCurrentContext(); + IMutableContext& getCurrentMutableContext(); + void cleanUpContext(); + Stream createStream( std::string const& streamName ); + +} + +// #included from: internal/catch_test_registry.hpp +#define TWOBLUECUBES_CATCH_TEST_REGISTRY_HPP_INCLUDED + +// #included from: catch_interfaces_testcase.h +#define TWOBLUECUBES_CATCH_INTERFACES_TESTCASE_H_INCLUDED + +#include + +namespace Catch { + + class TestSpec; + + struct ITestCase : IShared { + virtual void invoke () const = 0; + protected: + virtual ~ITestCase(); + }; + + class TestCase; + struct IConfig; + + struct ITestCaseRegistry { + virtual ~ITestCaseRegistry(); + virtual std::vector const& getAllTests() const = 0; + virtual std::vector const& getAllTestsSorted( IConfig const& config ) const = 0; + }; + + bool matchTest( TestCase const& testCase, TestSpec const& testSpec, IConfig const& config ); + std::vector filterTests( std::vector const& testCases, TestSpec const& testSpec, IConfig const& config ); + std::vector const& getAllTestCasesSorted( IConfig const& config ); + +} + +namespace Catch { + +template +class MethodTestCase : public SharedImpl { + +public: + MethodTestCase( void (C::*method)() ) : m_method( method ) {} + + virtual void invoke() const { + C obj; + (obj.*m_method)(); + } + +private: + virtual ~MethodTestCase() {} + + void (C::*m_method)(); +}; + +typedef void(*TestFunction)(); + +struct NameAndDesc { + NameAndDesc( const char* _name = "", const char* _description= "" ) + : name( _name ), description( _description ) + {} + + const char* name; + const char* description; +}; + +void registerTestCase + ( ITestCase* testCase, + char const* className, + NameAndDesc const& nameAndDesc, + SourceLineInfo const& lineInfo ); + +struct AutoReg { + + AutoReg + ( TestFunction function, + SourceLineInfo const& lineInfo, + NameAndDesc const& nameAndDesc ); + + template + AutoReg + ( void (C::*method)(), + char const* className, + NameAndDesc const& nameAndDesc, + SourceLineInfo const& lineInfo ) { + + registerTestCase + ( new MethodTestCase( method ), + className, + nameAndDesc, + lineInfo ); + } + + ~AutoReg(); + +private: + AutoReg( AutoReg const& ); + void operator= ( AutoReg const& ); +}; + +void registerTestCaseFunction + ( TestFunction function, + SourceLineInfo const& lineInfo, + NameAndDesc const& nameAndDesc ); + +} // end namespace Catch + +#ifdef CATCH_CONFIG_VARIADIC_MACROS + /////////////////////////////////////////////////////////////////////////////// + #define INTERNAL_CATCH_TESTCASE2( TestName, ... ) \ + static void TestName(); \ + CATCH_INTERNAL_SUPPRESS_ETD_WARNINGS \ + namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &TestName, CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( __VA_ARGS__ ) ); } /* NOLINT */ \ + CATCH_INTERNAL_UNSUPPRESS_ETD_WARNINGS \ + static void TestName() + #define INTERNAL_CATCH_TESTCASE( ... ) \ + INTERNAL_CATCH_TESTCASE2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), __VA_ARGS__ ) + + /////////////////////////////////////////////////////////////////////////////// + #define INTERNAL_CATCH_METHOD_AS_TEST_CASE( QualifiedMethod, ... ) \ + CATCH_INTERNAL_SUPPRESS_ETD_WARNINGS \ + namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &QualifiedMethod, "&" #QualifiedMethod, Catch::NameAndDesc( __VA_ARGS__ ), CATCH_INTERNAL_LINEINFO ); } /* NOLINT */ \ + CATCH_INTERNAL_UNSUPPRESS_ETD_WARNINGS + + /////////////////////////////////////////////////////////////////////////////// + #define INTERNAL_CATCH_TEST_CASE_METHOD2( TestName, ClassName, ... )\ + CATCH_INTERNAL_SUPPRESS_ETD_WARNINGS \ + namespace{ \ + struct TestName : ClassName{ \ + void test(); \ + }; \ + Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar ) ( &TestName::test, #ClassName, Catch::NameAndDesc( __VA_ARGS__ ), CATCH_INTERNAL_LINEINFO ); /* NOLINT */ \ + } \ + CATCH_INTERNAL_UNSUPPRESS_ETD_WARNINGS \ + void TestName::test() + #define INTERNAL_CATCH_TEST_CASE_METHOD( ClassName, ... ) \ + INTERNAL_CATCH_TEST_CASE_METHOD2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), ClassName, __VA_ARGS__ ) + + /////////////////////////////////////////////////////////////////////////////// + #define INTERNAL_CATCH_REGISTER_TESTCASE( Function, ... ) \ + CATCH_INTERNAL_SUPPRESS_ETD_WARNINGS \ + Catch::AutoReg( Function, CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( __VA_ARGS__ ) ); /* NOLINT */ \ + CATCH_INTERNAL_UNSUPPRESS_ETD_WARNINGS + +#else + /////////////////////////////////////////////////////////////////////////////// + #define INTERNAL_CATCH_TESTCASE2( TestName, Name, Desc ) \ + static void TestName(); \ + CATCH_INTERNAL_SUPPRESS_ETD_WARNINGS \ + namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &TestName, CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( Name, Desc ) ); } /* NOLINT */ \ + CATCH_INTERNAL_UNSUPPRESS_ETD_WARNINGS \ + static void TestName() + #define INTERNAL_CATCH_TESTCASE( Name, Desc ) \ + INTERNAL_CATCH_TESTCASE2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), Name, Desc ) + + /////////////////////////////////////////////////////////////////////////////// + #define INTERNAL_CATCH_METHOD_AS_TEST_CASE( QualifiedMethod, Name, Desc ) \ + CATCH_INTERNAL_SUPPRESS_ETD_WARNINGS \ + namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &QualifiedMethod, "&" #QualifiedMethod, Catch::NameAndDesc( Name, Desc ), CATCH_INTERNAL_LINEINFO ); } /* NOLINT */ \ + CATCH_INTERNAL_UNSUPPRESS_ETD_WARNINGS + + /////////////////////////////////////////////////////////////////////////////// + #define INTERNAL_CATCH_TEST_CASE_METHOD2( TestCaseName, ClassName, TestName, Desc )\ + CATCH_INTERNAL_SUPPRESS_ETD_WARNINGS \ + namespace{ \ + struct TestCaseName : ClassName{ \ + void test(); \ + }; \ + Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar ) ( &TestCaseName::test, #ClassName, Catch::NameAndDesc( TestName, Desc ), CATCH_INTERNAL_LINEINFO ); /* NOLINT */ \ + } \ + CATCH_INTERNAL_UNSUPPRESS_ETD_WARNINGS \ + void TestCaseName::test() + #define INTERNAL_CATCH_TEST_CASE_METHOD( ClassName, TestName, Desc )\ + INTERNAL_CATCH_TEST_CASE_METHOD2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), ClassName, TestName, Desc ) + + /////////////////////////////////////////////////////////////////////////////// + #define INTERNAL_CATCH_REGISTER_TESTCASE( Function, Name, Desc ) \ + CATCH_INTERNAL_SUPPRESS_ETD_WARNINGS \ + Catch::AutoReg( Function, CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( Name, Desc ) ); /* NOLINT */ \ + CATCH_INTERNAL_UNSUPPRESS_ETD_WARNINGS + +#endif + +// #included from: internal/catch_capture.hpp +#define TWOBLUECUBES_CATCH_CAPTURE_HPP_INCLUDED + +// #included from: catch_result_builder.h +#define TWOBLUECUBES_CATCH_RESULT_BUILDER_H_INCLUDED + +// #included from: catch_result_type.h +#define TWOBLUECUBES_CATCH_RESULT_TYPE_H_INCLUDED + +namespace Catch { + + // ResultWas::OfType enum + struct ResultWas { enum OfType { + Unknown = -1, + Ok = 0, + Info = 1, + Warning = 2, + + FailureBit = 0x10, + + ExpressionFailed = FailureBit | 1, + ExplicitFailure = FailureBit | 2, + + Exception = 0x100 | FailureBit, + + ThrewException = Exception | 1, + DidntThrowException = Exception | 2, + + FatalErrorCondition = 0x200 | FailureBit + + }; }; + + inline bool isOk( ResultWas::OfType resultType ) { + return ( resultType & ResultWas::FailureBit ) == 0; + } + inline bool isJustInfo( int flags ) { + return flags == ResultWas::Info; + } + + // ResultDisposition::Flags enum + struct ResultDisposition { enum Flags { + Normal = 0x01, + + ContinueOnFailure = 0x02, // Failures fail test, but execution continues + FalseTest = 0x04, // Prefix expression with ! + SuppressFail = 0x08 // Failures are reported but do not fail the test + }; }; + + inline ResultDisposition::Flags operator | ( ResultDisposition::Flags lhs, ResultDisposition::Flags rhs ) { + return static_cast( static_cast( lhs ) | static_cast( rhs ) ); + } + + inline bool shouldContinueOnFailure( int flags ) { return ( flags & ResultDisposition::ContinueOnFailure ) != 0; } + inline bool isFalseTest( int flags ) { return ( flags & ResultDisposition::FalseTest ) != 0; } + inline bool shouldSuppressFailure( int flags ) { return ( flags & ResultDisposition::SuppressFail ) != 0; } + +} // end namespace Catch + +// #included from: catch_assertionresult.h +#define TWOBLUECUBES_CATCH_ASSERTIONRESULT_H_INCLUDED + +#include + +namespace Catch { + + struct STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison; + + struct DecomposedExpression + { + virtual ~DecomposedExpression() {} + virtual bool isBinaryExpression() const { + return false; + } + virtual void reconstructExpression( std::string& dest ) const = 0; + + // Only simple binary comparisons can be decomposed. + // If more complex check is required then wrap sub-expressions in parentheses. + template STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator + ( T const& ); + template STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator - ( T const& ); + template STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator * ( T const& ); + template STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator / ( T const& ); + template STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator % ( T const& ); + template STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator && ( T const& ); + template STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator || ( T const& ); + + private: + DecomposedExpression& operator = (DecomposedExpression const&); + }; + + struct AssertionInfo + { + AssertionInfo(); + AssertionInfo( char const * _macroName, + SourceLineInfo const& _lineInfo, + char const * _capturedExpression, + ResultDisposition::Flags _resultDisposition, + char const * _secondArg = ""); + + char const * macroName; + SourceLineInfo lineInfo; + char const * capturedExpression; + ResultDisposition::Flags resultDisposition; + char const * secondArg; + }; + + struct AssertionResultData + { + AssertionResultData() : decomposedExpression( CATCH_NULL ) + , resultType( ResultWas::Unknown ) + , negated( false ) + , parenthesized( false ) {} + + void negate( bool parenthesize ) { + negated = !negated; + parenthesized = parenthesize; + if( resultType == ResultWas::Ok ) + resultType = ResultWas::ExpressionFailed; + else if( resultType == ResultWas::ExpressionFailed ) + resultType = ResultWas::Ok; + } + + std::string const& reconstructExpression() const { + if( decomposedExpression != CATCH_NULL ) { + decomposedExpression->reconstructExpression( reconstructedExpression ); + if( parenthesized ) { + reconstructedExpression.insert( 0, 1, '(' ); + reconstructedExpression.append( 1, ')' ); + } + if( negated ) { + reconstructedExpression.insert( 0, 1, '!' ); + } + decomposedExpression = CATCH_NULL; + } + return reconstructedExpression; + } + + mutable DecomposedExpression const* decomposedExpression; + mutable std::string reconstructedExpression; + std::string message; + ResultWas::OfType resultType; + bool negated; + bool parenthesized; + }; + + class AssertionResult { + public: + AssertionResult(); + AssertionResult( AssertionInfo const& info, AssertionResultData const& data ); + ~AssertionResult(); +# ifdef CATCH_CONFIG_CPP11_GENERATED_METHODS + AssertionResult( AssertionResult const& ) = default; + AssertionResult( AssertionResult && ) = default; + AssertionResult& operator = ( AssertionResult const& ) = default; + AssertionResult& operator = ( AssertionResult && ) = default; +# endif + + bool isOk() const; + bool succeeded() const; + ResultWas::OfType getResultType() const; + bool hasExpression() const; + bool hasMessage() const; + std::string getExpression() const; + std::string getExpressionInMacro() const; + bool hasExpandedExpression() const; + std::string getExpandedExpression() const; + std::string getMessage() const; + SourceLineInfo getSourceInfo() const; + std::string getTestMacroName() const; + void discardDecomposedExpression() const; + void expandDecomposedExpression() const; + + protected: + AssertionInfo m_info; + AssertionResultData m_resultData; + }; + +} // end namespace Catch + +// #included from: catch_matchers.hpp +#define TWOBLUECUBES_CATCH_MATCHERS_HPP_INCLUDED + +namespace Catch { +namespace Matchers { + namespace Impl { + + template struct MatchAllOf; + template struct MatchAnyOf; + template struct MatchNotOf; + + class MatcherUntypedBase { + public: + std::string toString() const { + if( m_cachedToString.empty() ) + m_cachedToString = describe(); + return m_cachedToString; + } + + protected: + virtual ~MatcherUntypedBase(); + virtual std::string describe() const = 0; + mutable std::string m_cachedToString; + private: + MatcherUntypedBase& operator = ( MatcherUntypedBase const& ); + }; + + template + struct MatcherMethod { + virtual bool match( ObjectT const& arg ) const = 0; + }; + template + struct MatcherMethod { + virtual bool match( PtrT* arg ) const = 0; + }; + + template + struct MatcherBase : MatcherUntypedBase, MatcherMethod { + + MatchAllOf operator && ( MatcherBase const& other ) const; + MatchAnyOf operator || ( MatcherBase const& other ) const; + MatchNotOf operator ! () const; + }; + + template + struct MatchAllOf : MatcherBase { + virtual bool match( ArgT const& arg ) const CATCH_OVERRIDE { + for( std::size_t i = 0; i < m_matchers.size(); ++i ) { + if (!m_matchers[i]->match(arg)) + return false; + } + return true; + } + virtual std::string describe() const CATCH_OVERRIDE { + std::string description; + description.reserve( 4 + m_matchers.size()*32 ); + description += "( "; + for( std::size_t i = 0; i < m_matchers.size(); ++i ) { + if( i != 0 ) + description += " and "; + description += m_matchers[i]->toString(); + } + description += " )"; + return description; + } + + MatchAllOf& operator && ( MatcherBase const& other ) { + m_matchers.push_back( &other ); + return *this; + } + + std::vector const*> m_matchers; + }; + template + struct MatchAnyOf : MatcherBase { + + virtual bool match( ArgT const& arg ) const CATCH_OVERRIDE { + for( std::size_t i = 0; i < m_matchers.size(); ++i ) { + if (m_matchers[i]->match(arg)) + return true; + } + return false; + } + virtual std::string describe() const CATCH_OVERRIDE { + std::string description; + description.reserve( 4 + m_matchers.size()*32 ); + description += "( "; + for( std::size_t i = 0; i < m_matchers.size(); ++i ) { + if( i != 0 ) + description += " or "; + description += m_matchers[i]->toString(); + } + description += " )"; + return description; + } + + MatchAnyOf& operator || ( MatcherBase const& other ) { + m_matchers.push_back( &other ); + return *this; + } + + std::vector const*> m_matchers; + }; + + template + struct MatchNotOf : MatcherBase { + + MatchNotOf( MatcherBase const& underlyingMatcher ) : m_underlyingMatcher( underlyingMatcher ) {} + + virtual bool match( ArgT const& arg ) const CATCH_OVERRIDE { + return !m_underlyingMatcher.match( arg ); + } + + virtual std::string describe() const CATCH_OVERRIDE { + return "not " + m_underlyingMatcher.toString(); + } + MatcherBase const& m_underlyingMatcher; + }; + + template + MatchAllOf MatcherBase::operator && ( MatcherBase const& other ) const { + return MatchAllOf() && *this && other; + } + template + MatchAnyOf MatcherBase::operator || ( MatcherBase const& other ) const { + return MatchAnyOf() || *this || other; + } + template + MatchNotOf MatcherBase::operator ! () const { + return MatchNotOf( *this ); + } + + } // namespace Impl + + // The following functions create the actual matcher objects. + // This allows the types to be inferred + // - deprecated: prefer ||, && and ! + template + Impl::MatchNotOf Not( Impl::MatcherBase const& underlyingMatcher ) { + return Impl::MatchNotOf( underlyingMatcher ); + } + template + Impl::MatchAllOf AllOf( Impl::MatcherBase const& m1, Impl::MatcherBase const& m2 ) { + return Impl::MatchAllOf() && m1 && m2; + } + template + Impl::MatchAllOf AllOf( Impl::MatcherBase const& m1, Impl::MatcherBase const& m2, Impl::MatcherBase const& m3 ) { + return Impl::MatchAllOf() && m1 && m2 && m3; + } + template + Impl::MatchAnyOf AnyOf( Impl::MatcherBase const& m1, Impl::MatcherBase const& m2 ) { + return Impl::MatchAnyOf() || m1 || m2; + } + template + Impl::MatchAnyOf AnyOf( Impl::MatcherBase const& m1, Impl::MatcherBase const& m2, Impl::MatcherBase const& m3 ) { + return Impl::MatchAnyOf() || m1 || m2 || m3; + } + +} // namespace Matchers + +using namespace Matchers; +using Matchers::Impl::MatcherBase; + +} // namespace Catch + +namespace Catch { + + struct TestFailureException{}; + + template class ExpressionLhs; + + struct CopyableStream { + CopyableStream() {} + CopyableStream( CopyableStream const& other ) { + oss << other.oss.str(); + } + CopyableStream& operator=( CopyableStream const& other ) { + oss.str(std::string()); + oss << other.oss.str(); + return *this; + } + std::ostringstream oss; + }; + + class ResultBuilder : public DecomposedExpression { + public: + ResultBuilder( char const* macroName, + SourceLineInfo const& lineInfo, + char const* capturedExpression, + ResultDisposition::Flags resultDisposition, + char const* secondArg = "" ); + ~ResultBuilder(); + + template + ExpressionLhs operator <= ( T const& operand ); + ExpressionLhs operator <= ( bool value ); + + template + ResultBuilder& operator << ( T const& value ) { + stream().oss << value; + return *this; + } + + ResultBuilder& setResultType( ResultWas::OfType result ); + ResultBuilder& setResultType( bool result ); + + void endExpression( DecomposedExpression const& expr ); + + virtual void reconstructExpression( std::string& dest ) const CATCH_OVERRIDE; + + AssertionResult build() const; + AssertionResult build( DecomposedExpression const& expr ) const; + + void useActiveException( ResultDisposition::Flags resultDisposition = ResultDisposition::Normal ); + void captureResult( ResultWas::OfType resultType ); + void captureExpression(); + void captureExpectedException( std::string const& expectedMessage ); + void captureExpectedException( Matchers::Impl::MatcherBase const& matcher ); + void handleResult( AssertionResult const& result ); + void react(); + bool shouldDebugBreak() const; + bool allowThrows() const; + + template + void captureMatch( ArgT const& arg, MatcherT const& matcher, char const* matcherString ); + + void setExceptionGuard(); + void unsetExceptionGuard(); + + private: + AssertionInfo m_assertionInfo; + AssertionResultData m_data; + + CopyableStream &stream() + { + if(!m_usedStream) + { + m_usedStream = true; + m_stream().oss.str(""); + } + return m_stream(); + } + + static CopyableStream &m_stream() + { + static CopyableStream s; + return s; + } + + bool m_shouldDebugBreak; + bool m_shouldThrow; + bool m_guardException; + bool m_usedStream; + }; + +} // namespace Catch + +// Include after due to circular dependency: +// #included from: catch_expression_lhs.hpp +#define TWOBLUECUBES_CATCH_EXPRESSION_LHS_HPP_INCLUDED + +// #included from: catch_evaluate.hpp +#define TWOBLUECUBES_CATCH_EVALUATE_HPP_INCLUDED + +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable:4389) // '==' : signed/unsigned mismatch +#pragma warning(disable:4018) // more "signed/unsigned mismatch" +#pragma warning(disable:4312) // Converting int to T* using reinterpret_cast (issue on x64 platform) +#endif + +#include + +namespace Catch { +namespace Internal { + + enum Operator { + IsEqualTo, + IsNotEqualTo, + IsLessThan, + IsGreaterThan, + IsLessThanOrEqualTo, + IsGreaterThanOrEqualTo + }; + + template struct OperatorTraits { static const char* getName(){ return "*error*"; } }; + template<> struct OperatorTraits { static const char* getName(){ return "=="; } }; + template<> struct OperatorTraits { static const char* getName(){ return "!="; } }; + template<> struct OperatorTraits { static const char* getName(){ return "<"; } }; + template<> struct OperatorTraits { static const char* getName(){ return ">"; } }; + template<> struct OperatorTraits { static const char* getName(){ return "<="; } }; + template<> struct OperatorTraits{ static const char* getName(){ return ">="; } }; + + template + T& removeConst(T const &t) { return const_cast(t); } +#ifdef CATCH_CONFIG_CPP11_NULLPTR + inline std::nullptr_t removeConst(std::nullptr_t) { return nullptr; } +#endif + + // So the compare overloads can be operator agnostic we convey the operator as a template + // enum, which is used to specialise an Evaluator for doing the comparison. + template + struct Evaluator{}; + + template + struct Evaluator { + static bool evaluate( T1 const& lhs, T2 const& rhs) { + return bool(removeConst(lhs) == removeConst(rhs) ); + } + }; + template + struct Evaluator { + static bool evaluate( T1 const& lhs, T2 const& rhs ) { + return bool(removeConst(lhs) != removeConst(rhs) ); + } + }; + template + struct Evaluator { + static bool evaluate( T1 const& lhs, T2 const& rhs ) { + return bool(removeConst(lhs) < removeConst(rhs) ); + } + }; + template + struct Evaluator { + static bool evaluate( T1 const& lhs, T2 const& rhs ) { + return bool(removeConst(lhs) > removeConst(rhs) ); + } + }; + template + struct Evaluator { + static bool evaluate( T1 const& lhs, T2 const& rhs ) { + return bool(removeConst(lhs) >= removeConst(rhs) ); + } + }; + template + struct Evaluator { + static bool evaluate( T1 const& lhs, T2 const& rhs ) { + return bool(removeConst(lhs) <= removeConst(rhs) ); + } + }; + + // Special case for comparing a pointer to an int (deduced for p==0) + template + struct Evaluator { + static bool evaluate( int lhs, T* rhs) { + return reinterpret_cast( lhs ) == rhs; + } + }; + template + struct Evaluator { + static bool evaluate( T* lhs, int rhs) { + return lhs == reinterpret_cast( rhs ); + } + }; + template + struct Evaluator { + static bool evaluate( int lhs, T* rhs) { + return reinterpret_cast( lhs ) != rhs; + } + }; + template + struct Evaluator { + static bool evaluate( T* lhs, int rhs) { + return lhs != reinterpret_cast( rhs ); + } + }; + + template + struct Evaluator { + static bool evaluate( long lhs, T* rhs) { + return reinterpret_cast( lhs ) == rhs; + } + }; + template + struct Evaluator { + static bool evaluate( T* lhs, long rhs) { + return lhs == reinterpret_cast( rhs ); + } + }; + template + struct Evaluator { + static bool evaluate( long lhs, T* rhs) { + return reinterpret_cast( lhs ) != rhs; + } + }; + template + struct Evaluator { + static bool evaluate( T* lhs, long rhs) { + return lhs != reinterpret_cast( rhs ); + } + }; + +} // end of namespace Internal +} // end of namespace Catch + +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +// #included from: catch_tostring.h +#define TWOBLUECUBES_CATCH_TOSTRING_H_INCLUDED + +#include +#include +#include +#include +#include + +#ifdef __OBJC__ +// #included from: catch_objc_arc.hpp +#define TWOBLUECUBES_CATCH_OBJC_ARC_HPP_INCLUDED + +#import + +#ifdef __has_feature +#define CATCH_ARC_ENABLED __has_feature(objc_arc) +#else +#define CATCH_ARC_ENABLED 0 +#endif + +void arcSafeRelease( NSObject* obj ); +id performOptionalSelector( id obj, SEL sel ); + +#if !CATCH_ARC_ENABLED +inline void arcSafeRelease( NSObject* obj ) { + [obj release]; +} +inline id performOptionalSelector( id obj, SEL sel ) { + if( [obj respondsToSelector: sel] ) + return [obj performSelector: sel]; + return nil; +} +#define CATCH_UNSAFE_UNRETAINED +#define CATCH_ARC_STRONG +#else +inline void arcSafeRelease( NSObject* ){} +inline id performOptionalSelector( id obj, SEL sel ) { +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Warc-performSelector-leaks" +#endif + if( [obj respondsToSelector: sel] ) + return [obj performSelector: sel]; +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + return nil; +} +#define CATCH_UNSAFE_UNRETAINED __unsafe_unretained +#define CATCH_ARC_STRONG __strong +#endif + +#endif + +#ifdef CATCH_CONFIG_CPP11_TUPLE +#include +#endif + +#ifdef CATCH_CONFIG_CPP11_IS_ENUM +#include +#endif + +namespace Catch { + +// Why we're here. +template +std::string toString( T const& value ); + +// Built in overloads + +std::string toString( std::string const& value ); +std::string toString( std::wstring const& value ); +std::string toString( const char* const value ); +std::string toString( char* const value ); +std::string toString( const wchar_t* const value ); +std::string toString( wchar_t* const value ); +std::string toString( int value ); +std::string toString( unsigned long value ); +std::string toString( unsigned int value ); +std::string toString( const double value ); +std::string toString( const float value ); +std::string toString( bool value ); +std::string toString( char value ); +std::string toString( signed char value ); +std::string toString( unsigned char value ); + +#ifdef CATCH_CONFIG_CPP11_LONG_LONG +std::string toString( long long value ); +std::string toString( unsigned long long value ); +#endif + +#ifdef CATCH_CONFIG_CPP11_NULLPTR +std::string toString( std::nullptr_t ); +#endif + +#ifdef __OBJC__ + std::string toString( NSString const * const& nsstring ); + std::string toString( NSString * CATCH_ARC_STRONG & nsstring ); + std::string toString( NSObject* const& nsObject ); +#endif + +namespace Detail { + + extern const std::string unprintableString; + + #if !defined(CATCH_CONFIG_CPP11_STREAM_INSERTABLE_CHECK) + struct BorgType { + template BorgType( T const& ); + }; + + struct TrueType { char sizer[1]; }; + struct FalseType { char sizer[2]; }; + + TrueType& testStreamable( std::ostream& ); + FalseType testStreamable( FalseType ); + + FalseType operator<<( std::ostream const&, BorgType const& ); + + template + struct IsStreamInsertable { + static std::ostream &s; + static T const&t; + enum { value = sizeof( testStreamable(s << t) ) == sizeof( TrueType ) }; + }; +#else + template + class IsStreamInsertable { + template + static auto test(int) + -> decltype( std::declval() << std::declval(), std::true_type() ); + + template + static auto test(...) -> std::false_type; + + public: + static const bool value = decltype(test(0))::value; + }; +#endif + +#if defined(CATCH_CONFIG_CPP11_IS_ENUM) + template::value + > + struct EnumStringMaker + { + static std::string convert( T const& ) { return unprintableString; } + }; + + template + struct EnumStringMaker + { + static std::string convert( T const& v ) + { + return ::Catch::toString( + static_cast::type>(v) + ); + } + }; +#endif + template + struct StringMakerBase { +#if defined(CATCH_CONFIG_CPP11_IS_ENUM) + template + static std::string convert( T const& v ) + { + return EnumStringMaker::convert( v ); + } +#else + template + static std::string convert( T const& ) { return unprintableString; } +#endif + }; + + template<> + struct StringMakerBase { + template + static std::string convert( T const& _value ) { + std::ostringstream oss; + oss << _value; + return oss.str(); + } + }; + + std::string rawMemoryToString( const void *object, std::size_t size ); + + template + std::string rawMemoryToString( const T& object ) { + return rawMemoryToString( &object, sizeof(object) ); + } + +} // end namespace Detail + +template +struct StringMaker : + Detail::StringMakerBase::value> {}; + +template +struct StringMaker { + template + static std::string convert( U* p ) { + if( !p ) + return "NULL"; + else + return Detail::rawMemoryToString( p ); + } +}; + +template +struct StringMaker { + static std::string convert( R C::* p ) { + if( !p ) + return "NULL"; + else + return Detail::rawMemoryToString( p ); + } +}; + +namespace Detail { + template + std::string rangeToString( InputIterator first, InputIterator last ); +} + +//template +//struct StringMaker > { +// static std::string convert( std::vector const& v ) { +// return Detail::rangeToString( v.begin(), v.end() ); +// } +//}; + +template +std::string toString( std::vector const& v ) { + return Detail::rangeToString( v.begin(), v.end() ); +} + +#ifdef CATCH_CONFIG_CPP11_TUPLE + +// toString for tuples +namespace TupleDetail { + template< + typename Tuple, + std::size_t N = 0, + bool = (N < std::tuple_size::value) + > + struct ElementPrinter { + static void print( const Tuple& tuple, std::ostream& os ) + { + os << ( N ? ", " : " " ) + << Catch::toString(std::get(tuple)); + ElementPrinter::print(tuple,os); + } + }; + + template< + typename Tuple, + std::size_t N + > + struct ElementPrinter { + static void print( const Tuple&, std::ostream& ) {} + }; + +} + +template +struct StringMaker> { + + static std::string convert( const std::tuple& tuple ) + { + std::ostringstream os; + os << '{'; + TupleDetail::ElementPrinter>::print( tuple, os ); + os << " }"; + return os.str(); + } +}; +#endif // CATCH_CONFIG_CPP11_TUPLE + +namespace Detail { + template + std::string makeString( T const& value ) { + return StringMaker::convert( value ); + } +} // end namespace Detail + +/// \brief converts any type to a string +/// +/// The default template forwards on to ostringstream - except when an +/// ostringstream overload does not exist - in which case it attempts to detect +/// that and writes {?}. +/// Overload (not specialise) this template for custom typs that you don't want +/// to provide an ostream overload for. +template +std::string toString( T const& value ) { + return StringMaker::convert( value ); +} + + namespace Detail { + template + std::string rangeToString( InputIterator first, InputIterator last ) { + std::ostringstream oss; + oss << "{ "; + if( first != last ) { + oss << Catch::toString( *first ); + for( ++first ; first != last ; ++first ) + oss << ", " << Catch::toString( *first ); + } + oss << " }"; + return oss.str(); + } +} + +} // end namespace Catch + +namespace Catch { + +template +class BinaryExpression; + +template +class MatchExpression; + +// Wraps the LHS of an expression and overloads comparison operators +// for also capturing those and RHS (if any) +template +class ExpressionLhs : public DecomposedExpression { +public: + ExpressionLhs( ResultBuilder& rb, T lhs ) : m_rb( rb ), m_lhs( lhs ), m_truthy(false) {} + + ExpressionLhs& operator = ( const ExpressionLhs& ); + + template + BinaryExpression + operator == ( RhsT const& rhs ) { + return captureExpression( rhs ); + } + + template + BinaryExpression + operator != ( RhsT const& rhs ) { + return captureExpression( rhs ); + } + + template + BinaryExpression + operator < ( RhsT const& rhs ) { + return captureExpression( rhs ); + } + + template + BinaryExpression + operator > ( RhsT const& rhs ) { + return captureExpression( rhs ); + } + + template + BinaryExpression + operator <= ( RhsT const& rhs ) { + return captureExpression( rhs ); + } + + template + BinaryExpression + operator >= ( RhsT const& rhs ) { + return captureExpression( rhs ); + } + + BinaryExpression operator == ( bool rhs ) { + return captureExpression( rhs ); + } + + BinaryExpression operator != ( bool rhs ) { + return captureExpression( rhs ); + } + + void endExpression() { + m_truthy = m_lhs ? true : false; + m_rb + .setResultType( m_truthy ) + .endExpression( *this ); + } + + virtual void reconstructExpression( std::string& dest ) const CATCH_OVERRIDE { + dest = Catch::toString( m_lhs ); + } + +private: + template + BinaryExpression captureExpression( RhsT& rhs ) const { + return BinaryExpression( m_rb, m_lhs, rhs ); + } + + template + BinaryExpression captureExpression( bool rhs ) const { + return BinaryExpression( m_rb, m_lhs, rhs ); + } + +private: + ResultBuilder& m_rb; + T m_lhs; + bool m_truthy; +}; + +template +class BinaryExpression : public DecomposedExpression { +public: + BinaryExpression( ResultBuilder& rb, LhsT lhs, RhsT rhs ) + : m_rb( rb ), m_lhs( lhs ), m_rhs( rhs ) {} + + BinaryExpression& operator = ( BinaryExpression& ); + + void endExpression() const { + m_rb + .setResultType( Internal::Evaluator::evaluate( m_lhs, m_rhs ) ) + .endExpression( *this ); + } + + virtual bool isBinaryExpression() const CATCH_OVERRIDE { + return true; + } + + virtual void reconstructExpression( std::string& dest ) const CATCH_OVERRIDE { + std::string lhs = Catch::toString( m_lhs ); + std::string rhs = Catch::toString( m_rhs ); + char delim = lhs.size() + rhs.size() < 40 && + lhs.find('\n') == std::string::npos && + rhs.find('\n') == std::string::npos ? ' ' : '\n'; + dest.reserve( 7 + lhs.size() + rhs.size() ); + // 2 for spaces around operator + // 2 for operator + // 2 for parentheses (conditionally added later) + // 1 for negation (conditionally added later) + dest = lhs; + dest += delim; + dest += Internal::OperatorTraits::getName(); + dest += delim; + dest += rhs; + } + +private: + ResultBuilder& m_rb; + LhsT m_lhs; + RhsT m_rhs; +}; + +template +class MatchExpression : public DecomposedExpression { +public: + MatchExpression( ArgT arg, MatcherT matcher, char const* matcherString ) + : m_arg( arg ), m_matcher( matcher ), m_matcherString( matcherString ) {} + + virtual bool isBinaryExpression() const CATCH_OVERRIDE { + return true; + } + + virtual void reconstructExpression( std::string& dest ) const CATCH_OVERRIDE { + std::string matcherAsString = m_matcher.toString(); + dest = Catch::toString( m_arg ); + dest += ' '; + if( matcherAsString == Detail::unprintableString ) + dest += m_matcherString; + else + dest += matcherAsString; + } + +private: + ArgT m_arg; + MatcherT m_matcher; + char const* m_matcherString; +}; + +} // end namespace Catch + + +namespace Catch { + + template + ExpressionLhs ResultBuilder::operator <= ( T const& operand ) { + return ExpressionLhs( *this, operand ); + } + + inline ExpressionLhs ResultBuilder::operator <= ( bool value ) { + return ExpressionLhs( *this, value ); + } + + template + void ResultBuilder::captureMatch( ArgT const& arg, MatcherT const& matcher, + char const* matcherString ) { + MatchExpression expr( arg, matcher, matcherString ); + setResultType( matcher.match( arg ) ); + endExpression( expr ); + } + +} // namespace Catch + +// #included from: catch_message.h +#define TWOBLUECUBES_CATCH_MESSAGE_H_INCLUDED + +#include + +namespace Catch { + + struct MessageInfo { + MessageInfo( std::string const& _macroName, + SourceLineInfo const& _lineInfo, + ResultWas::OfType _type ); + + std::string macroName; + SourceLineInfo lineInfo; + ResultWas::OfType type; + std::string message; + unsigned int sequence; + + bool operator == ( MessageInfo const& other ) const { + return sequence == other.sequence; + } + bool operator < ( MessageInfo const& other ) const { + return sequence < other.sequence; + } + private: + static unsigned int globalCount; + }; + + struct MessageBuilder { + MessageBuilder( std::string const& macroName, + SourceLineInfo const& lineInfo, + ResultWas::OfType type ) + : m_info( macroName, lineInfo, type ) + {} + + template + MessageBuilder& operator << ( T const& value ) { + m_stream << value; + return *this; + } + + MessageInfo m_info; + std::ostringstream m_stream; + }; + + class ScopedMessage { + public: + ScopedMessage( MessageBuilder const& builder ); + ScopedMessage( ScopedMessage const& other ); + ~ScopedMessage(); + + MessageInfo m_info; + }; + +} // end namespace Catch + +// #included from: catch_interfaces_capture.h +#define TWOBLUECUBES_CATCH_INTERFACES_CAPTURE_H_INCLUDED + +#include + +namespace Catch { + + class TestCase; + class AssertionResult; + struct AssertionInfo; + struct SectionInfo; + struct SectionEndInfo; + struct MessageInfo; + class ScopedMessageBuilder; + struct Counts; + + struct IResultCapture { + + virtual ~IResultCapture(); + + virtual void assertionEnded( AssertionResult const& result ) = 0; + virtual bool sectionStarted( SectionInfo const& sectionInfo, + Counts& assertions ) = 0; + virtual void sectionEnded( SectionEndInfo const& endInfo ) = 0; + virtual void sectionEndedEarly( SectionEndInfo const& endInfo ) = 0; + virtual void pushScopedMessage( MessageInfo const& message ) = 0; + virtual void popScopedMessage( MessageInfo const& message ) = 0; + + virtual std::string getCurrentTestName() const = 0; + virtual const AssertionResult* getLastResult() const = 0; + + virtual void exceptionEarlyReported() = 0; + + virtual void handleFatalErrorCondition( std::string const& message ) = 0; + + virtual bool lastAssertionPassed() = 0; + virtual void assertionPassed() = 0; + virtual void assertionRun() = 0; + }; + + IResultCapture& getResultCapture(); +} + +// #included from: catch_debugger.h +#define TWOBLUECUBES_CATCH_DEBUGGER_H_INCLUDED + +// #included from: catch_platform.h +#define TWOBLUECUBES_CATCH_PLATFORM_H_INCLUDED + +#if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) +# define CATCH_PLATFORM_MAC +#elif defined(__IPHONE_OS_VERSION_MIN_REQUIRED) +# define CATCH_PLATFORM_IPHONE +#elif defined(linux) || defined(__linux) || defined(__linux__) +# define CATCH_PLATFORM_LINUX +#elif defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER) +# define CATCH_PLATFORM_WINDOWS +# if !defined(NOMINMAX) && !defined(CATCH_CONFIG_NO_NOMINMAX) +# define CATCH_DEFINES_NOMINMAX +# endif +# if !defined(WIN32_LEAN_AND_MEAN) && !defined(CATCH_CONFIG_NO_WIN32_LEAN_AND_MEAN) +# define CATCH_DEFINES_WIN32_LEAN_AND_MEAN +# endif +#endif + +#include + +namespace Catch{ + + bool isDebuggerActive(); + void writeToDebugConsole( std::string const& text ); +} + +#ifdef CATCH_PLATFORM_MAC + + // The following code snippet based on: + // http://cocoawithlove.com/2008/03/break-into-debugger.html + #if defined(__ppc64__) || defined(__ppc__) + #define CATCH_TRAP() \ + __asm__("li r0, 20\nsc\nnop\nli r0, 37\nli r4, 2\nsc\nnop\n" \ + : : : "memory","r0","r3","r4" ) /* NOLINT */ + #else + #define CATCH_TRAP() __asm__("int $3\n" : : /* NOLINT */ ) + #endif + +#elif defined(CATCH_PLATFORM_LINUX) + // If we can use inline assembler, do it because this allows us to break + // directly at the location of the failing check instead of breaking inside + // raise() called from it, i.e. one stack frame below. + #if defined(__GNUC__) && (defined(__i386) || defined(__x86_64)) + #define CATCH_TRAP() asm volatile ("int $3") /* NOLINT */ + #else // Fall back to the generic way. + #include + + #define CATCH_TRAP() raise(SIGTRAP) + #endif +#elif defined(_MSC_VER) + #define CATCH_TRAP() __debugbreak() +#elif defined(__MINGW32__) + extern "C" __declspec(dllimport) void __stdcall DebugBreak(); + #define CATCH_TRAP() DebugBreak() +#endif + +#ifdef CATCH_TRAP + #define CATCH_BREAK_INTO_DEBUGGER() if( Catch::isDebuggerActive() ) { CATCH_TRAP(); } +#else + #define CATCH_BREAK_INTO_DEBUGGER() Catch::alwaysTrue(); +#endif + +// #included from: catch_interfaces_runner.h +#define TWOBLUECUBES_CATCH_INTERFACES_RUNNER_H_INCLUDED + +namespace Catch { + class TestCase; + + struct IRunner { + virtual ~IRunner(); + virtual bool aborting() const = 0; + }; +} + +#if !defined(CATCH_CONFIG_DISABLE_STRINGIFICATION) +# define CATCH_INTERNAL_STRINGIFY(expr) #expr +#else +# define CATCH_INTERNAL_STRINGIFY(expr) "Disabled by CATCH_CONFIG_DISABLE_STRINGIFICATION" +#endif + +#if defined(CATCH_CONFIG_FAST_COMPILE) +/////////////////////////////////////////////////////////////////////////////// +// We can speedup compilation significantly by breaking into debugger lower in +// the callstack, because then we don't have to expand CATCH_BREAK_INTO_DEBUGGER +// macro in each assertion +#define INTERNAL_CATCH_REACT( resultBuilder ) \ + resultBuilder.react(); + +/////////////////////////////////////////////////////////////////////////////// +// Another way to speed-up compilation is to omit local try-catch for REQUIRE* +// macros. +// This can potentially cause false negative, if the test code catches +// the exception before it propagates back up to the runner. +#define INTERNAL_CATCH_TEST_NO_TRY( macroName, resultDisposition, expr ) \ + do { \ + Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(expr), resultDisposition ); \ + __catchResult.setExceptionGuard(); \ + CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \ + ( __catchResult <= expr ).endExpression(); \ + CATCH_INTERNAL_UNSUPPRESS_PARENTHESES_WARNINGS \ + __catchResult.unsetExceptionGuard(); \ + INTERNAL_CATCH_REACT( __catchResult ) \ + } while( Catch::isTrue( false && static_cast( !!(expr) ) ) ) // expr here is never evaluated at runtime but it forces the compiler to give it a look +// The double negation silences MSVC's C4800 warning, the static_cast forces short-circuit evaluation if the type has overloaded &&. + +#define INTERNAL_CHECK_THAT_NO_TRY( macroName, matcher, resultDisposition, arg ) \ + do { \ + Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(arg) ", " CATCH_INTERNAL_STRINGIFY(matcher), resultDisposition ); \ + __catchResult.setExceptionGuard(); \ + __catchResult.captureMatch( arg, matcher, CATCH_INTERNAL_STRINGIFY(matcher) ); \ + __catchResult.unsetExceptionGuard(); \ + INTERNAL_CATCH_REACT( __catchResult ) \ + } while( Catch::alwaysFalse() ) + +#else +/////////////////////////////////////////////////////////////////////////////// +// In the event of a failure works out if the debugger needs to be invoked +// and/or an exception thrown and takes appropriate action. +// This needs to be done as a macro so the debugger will stop in the user +// source code rather than in Catch library code +#define INTERNAL_CATCH_REACT( resultBuilder ) \ + if( resultBuilder.shouldDebugBreak() ) CATCH_BREAK_INTO_DEBUGGER(); \ + resultBuilder.react(); +#endif + +/////////////////////////////////////////////////////////////////////////////// +#define INTERNAL_CATCH_TEST( macroName, resultDisposition, expr ) \ + do { \ + Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(expr), resultDisposition ); \ + try { \ + CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \ + ( __catchResult <= expr ).endExpression(); \ + CATCH_INTERNAL_UNSUPPRESS_PARENTHESES_WARNINGS \ + } \ + catch( ... ) { \ + __catchResult.useActiveException( resultDisposition ); \ + } \ + INTERNAL_CATCH_REACT( __catchResult ) \ + } while( Catch::isTrue( false && static_cast( !!(expr) ) ) ) // expr here is never evaluated at runtime but it forces the compiler to give it a look + // The double negation silences MSVC's C4800 warning, the static_cast forces short-circuit evaluation if the type has overloaded &&. + +/////////////////////////////////////////////////////////////////////////////// +#define INTERNAL_CATCH_IF( macroName, resultDisposition, expr ) \ + INTERNAL_CATCH_TEST( macroName, resultDisposition, expr ); \ + if( Catch::getResultCapture().lastAssertionPassed() ) + +/////////////////////////////////////////////////////////////////////////////// +#define INTERNAL_CATCH_ELSE( macroName, resultDisposition, expr ) \ + INTERNAL_CATCH_TEST( macroName, resultDisposition, expr ); \ + if( !Catch::getResultCapture().lastAssertionPassed() ) + +/////////////////////////////////////////////////////////////////////////////// +#define INTERNAL_CATCH_NO_THROW( macroName, resultDisposition, expr ) \ + do { \ + Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(expr), resultDisposition ); \ + try { \ + static_cast(expr); \ + __catchResult.captureResult( Catch::ResultWas::Ok ); \ + } \ + catch( ... ) { \ + __catchResult.useActiveException( resultDisposition ); \ + } \ + INTERNAL_CATCH_REACT( __catchResult ) \ + } while( Catch::alwaysFalse() ) + +/////////////////////////////////////////////////////////////////////////////// +#define INTERNAL_CATCH_THROWS( macroName, resultDisposition, matcher, expr ) \ + do { \ + Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(expr), resultDisposition, CATCH_INTERNAL_STRINGIFY(matcher) ); \ + if( __catchResult.allowThrows() ) \ + try { \ + static_cast(expr); \ + __catchResult.captureResult( Catch::ResultWas::DidntThrowException ); \ + } \ + catch( ... ) { \ + __catchResult.captureExpectedException( matcher ); \ + } \ + else \ + __catchResult.captureResult( Catch::ResultWas::Ok ); \ + INTERNAL_CATCH_REACT( __catchResult ) \ + } while( Catch::alwaysFalse() ) + +/////////////////////////////////////////////////////////////////////////////// +#define INTERNAL_CATCH_THROWS_AS( macroName, exceptionType, resultDisposition, expr ) \ + do { \ + Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(expr) ", " CATCH_INTERNAL_STRINGIFY(exceptionType), resultDisposition ); \ + if( __catchResult.allowThrows() ) \ + try { \ + static_cast(expr); \ + __catchResult.captureResult( Catch::ResultWas::DidntThrowException ); \ + } \ + catch( exceptionType ) { \ + __catchResult.captureResult( Catch::ResultWas::Ok ); \ + } \ + catch( ... ) { \ + __catchResult.useActiveException( resultDisposition ); \ + } \ + else \ + __catchResult.captureResult( Catch::ResultWas::Ok ); \ + INTERNAL_CATCH_REACT( __catchResult ) \ + } while( Catch::alwaysFalse() ) + +/////////////////////////////////////////////////////////////////////////////// +#ifdef CATCH_CONFIG_VARIADIC_MACROS + #define INTERNAL_CATCH_MSG( macroName, messageType, resultDisposition, ... ) \ + do { \ + Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, "", resultDisposition ); \ + __catchResult << __VA_ARGS__ + ::Catch::StreamEndStop(); \ + __catchResult.captureResult( messageType ); \ + INTERNAL_CATCH_REACT( __catchResult ) \ + } while( Catch::alwaysFalse() ) +#else + #define INTERNAL_CATCH_MSG( macroName, messageType, resultDisposition, log ) \ + do { \ + Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, "", resultDisposition ); \ + __catchResult << log + ::Catch::StreamEndStop(); \ + __catchResult.captureResult( messageType ); \ + INTERNAL_CATCH_REACT( __catchResult ) \ + } while( Catch::alwaysFalse() ) +#endif + +/////////////////////////////////////////////////////////////////////////////// +#define INTERNAL_CATCH_INFO( macroName, log ) \ + Catch::ScopedMessage INTERNAL_CATCH_UNIQUE_NAME( scopedMessage ) = Catch::MessageBuilder( macroName, CATCH_INTERNAL_LINEINFO, Catch::ResultWas::Info ) << log; + +/////////////////////////////////////////////////////////////////////////////// +#define INTERNAL_CHECK_THAT( macroName, matcher, resultDisposition, arg ) \ + do { \ + Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(arg) ", " CATCH_INTERNAL_STRINGIFY(matcher), resultDisposition ); \ + try { \ + __catchResult.captureMatch( arg, matcher, CATCH_INTERNAL_STRINGIFY(matcher) ); \ + } catch( ... ) { \ + __catchResult.useActiveException( resultDisposition | Catch::ResultDisposition::ContinueOnFailure ); \ + } \ + INTERNAL_CATCH_REACT( __catchResult ) \ + } while( Catch::alwaysFalse() ) + +// #included from: internal/catch_section.h +#define TWOBLUECUBES_CATCH_SECTION_H_INCLUDED + +// #included from: catch_section_info.h +#define TWOBLUECUBES_CATCH_SECTION_INFO_H_INCLUDED + +// #included from: catch_totals.hpp +#define TWOBLUECUBES_CATCH_TOTALS_HPP_INCLUDED + +#include + +namespace Catch { + + struct Counts { + Counts() : passed( 0 ), failed( 0 ), failedButOk( 0 ) {} + + Counts operator - ( Counts const& other ) const { + Counts diff; + diff.passed = passed - other.passed; + diff.failed = failed - other.failed; + diff.failedButOk = failedButOk - other.failedButOk; + return diff; + } + Counts& operator += ( Counts const& other ) { + passed += other.passed; + failed += other.failed; + failedButOk += other.failedButOk; + return *this; + } + + std::size_t total() const { + return passed + failed + failedButOk; + } + bool allPassed() const { + return failed == 0 && failedButOk == 0; + } + bool allOk() const { + return failed == 0; + } + + std::size_t passed; + std::size_t failed; + std::size_t failedButOk; + }; + + struct Totals { + + Totals operator - ( Totals const& other ) const { + Totals diff; + diff.assertions = assertions - other.assertions; + diff.testCases = testCases - other.testCases; + return diff; + } + + Totals delta( Totals const& prevTotals ) const { + Totals diff = *this - prevTotals; + if( diff.assertions.failed > 0 ) + ++diff.testCases.failed; + else if( diff.assertions.failedButOk > 0 ) + ++diff.testCases.failedButOk; + else + ++diff.testCases.passed; + return diff; + } + + Totals& operator += ( Totals const& other ) { + assertions += other.assertions; + testCases += other.testCases; + return *this; + } + + Counts assertions; + Counts testCases; + }; +} + +#include + +namespace Catch { + + struct SectionInfo { + SectionInfo + ( SourceLineInfo const& _lineInfo, + std::string const& _name, + std::string const& _description = std::string() ); + + std::string name; + std::string description; + SourceLineInfo lineInfo; + }; + + struct SectionEndInfo { + SectionEndInfo( SectionInfo const& _sectionInfo, Counts const& _prevAssertions, double _durationInSeconds ) + : sectionInfo( _sectionInfo ), prevAssertions( _prevAssertions ), durationInSeconds( _durationInSeconds ) + {} + + SectionInfo sectionInfo; + Counts prevAssertions; + double durationInSeconds; + }; + +} // end namespace Catch + +// #included from: catch_timer.h +#define TWOBLUECUBES_CATCH_TIMER_H_INCLUDED + +#ifdef _MSC_VER + +namespace Catch { + typedef unsigned long long UInt64; +} +#else +#include +namespace Catch { + typedef uint64_t UInt64; +} +#endif + +namespace Catch { + class Timer { + public: + Timer() : m_ticks( 0 ) {} + void start(); + unsigned int getElapsedMicroseconds() const; + unsigned int getElapsedMilliseconds() const; + double getElapsedSeconds() const; + + private: + UInt64 m_ticks; + }; + +} // namespace Catch + +#include + +namespace Catch { + + class Section : NonCopyable { + public: + Section( SectionInfo const& info ); + ~Section(); + + // This indicates whether the section should be executed or not + operator bool() const; + + private: + SectionInfo m_info; + + std::string m_name; + Counts m_assertions; + bool m_sectionIncluded; + Timer m_timer; + }; + +} // end namespace Catch + +#ifdef CATCH_CONFIG_VARIADIC_MACROS + #define INTERNAL_CATCH_SECTION( ... ) \ + if( Catch::Section const& INTERNAL_CATCH_UNIQUE_NAME( catch_internal_Section ) = Catch::SectionInfo( CATCH_INTERNAL_LINEINFO, __VA_ARGS__ ) ) +#else + #define INTERNAL_CATCH_SECTION( name, desc ) \ + if( Catch::Section const& INTERNAL_CATCH_UNIQUE_NAME( catch_internal_Section ) = Catch::SectionInfo( CATCH_INTERNAL_LINEINFO, name, desc ) ) +#endif + +// #included from: internal/catch_generators.hpp +#define TWOBLUECUBES_CATCH_GENERATORS_HPP_INCLUDED + +#include +#include +#include + +namespace Catch { + +template +struct IGenerator { + virtual ~IGenerator() {} + virtual T getValue( std::size_t index ) const = 0; + virtual std::size_t size () const = 0; +}; + +template +class BetweenGenerator : public IGenerator { +public: + BetweenGenerator( T from, T to ) : m_from( from ), m_to( to ){} + + virtual T getValue( std::size_t index ) const { + return m_from+static_cast( index ); + } + + virtual std::size_t size() const { + return static_cast( 1+m_to-m_from ); + } + +private: + + T m_from; + T m_to; +}; + +template +class ValuesGenerator : public IGenerator { +public: + ValuesGenerator(){} + + void add( T value ) { + m_values.push_back( value ); + } + + virtual T getValue( std::size_t index ) const { + return m_values[index]; + } + + virtual std::size_t size() const { + return m_values.size(); + } + +private: + std::vector m_values; +}; + +template +class CompositeGenerator { +public: + CompositeGenerator() : m_totalSize( 0 ) {} + + // *** Move semantics, similar to auto_ptr *** + CompositeGenerator( CompositeGenerator& other ) + : m_fileInfo( other.m_fileInfo ), + m_totalSize( 0 ) + { + move( other ); + } + + CompositeGenerator& setFileInfo( const char* fileInfo ) { + m_fileInfo = fileInfo; + return *this; + } + + ~CompositeGenerator() { + deleteAll( m_composed ); + } + + operator T () const { + size_t overallIndex = getCurrentContext().getGeneratorIndex( m_fileInfo, m_totalSize ); + + typename std::vector*>::const_iterator it = m_composed.begin(); + typename std::vector*>::const_iterator itEnd = m_composed.end(); + for( size_t index = 0; it != itEnd; ++it ) + { + const IGenerator* generator = *it; + if( overallIndex >= index && overallIndex < index + generator->size() ) + { + return generator->getValue( overallIndex-index ); + } + index += generator->size(); + } + CATCH_INTERNAL_ERROR( "Indexed past end of generated range" ); + return T(); // Suppress spurious "not all control paths return a value" warning in Visual Studio - if you know how to fix this please do so + } + + void add( const IGenerator* generator ) { + m_totalSize += generator->size(); + m_composed.push_back( generator ); + } + + CompositeGenerator& then( CompositeGenerator& other ) { + move( other ); + return *this; + } + + CompositeGenerator& then( T value ) { + ValuesGenerator* valuesGen = new ValuesGenerator(); + valuesGen->add( value ); + add( valuesGen ); + return *this; + } + +private: + + void move( CompositeGenerator& other ) { + m_composed.insert( m_composed.end(), other.m_composed.begin(), other.m_composed.end() ); + m_totalSize += other.m_totalSize; + other.m_composed.clear(); + } + + std::vector*> m_composed; + std::string m_fileInfo; + size_t m_totalSize; +}; + +namespace Generators +{ + template + CompositeGenerator between( T from, T to ) { + CompositeGenerator generators; + generators.add( new BetweenGenerator( from, to ) ); + return generators; + } + + template + CompositeGenerator values( T val1, T val2 ) { + CompositeGenerator generators; + ValuesGenerator* valuesGen = new ValuesGenerator(); + valuesGen->add( val1 ); + valuesGen->add( val2 ); + generators.add( valuesGen ); + return generators; + } + + template + CompositeGenerator values( T val1, T val2, T val3 ){ + CompositeGenerator generators; + ValuesGenerator* valuesGen = new ValuesGenerator(); + valuesGen->add( val1 ); + valuesGen->add( val2 ); + valuesGen->add( val3 ); + generators.add( valuesGen ); + return generators; + } + + template + CompositeGenerator values( T val1, T val2, T val3, T val4 ) { + CompositeGenerator generators; + ValuesGenerator* valuesGen = new ValuesGenerator(); + valuesGen->add( val1 ); + valuesGen->add( val2 ); + valuesGen->add( val3 ); + valuesGen->add( val4 ); + generators.add( valuesGen ); + return generators; + } + +} // end namespace Generators + +using namespace Generators; + +} // end namespace Catch + +#define INTERNAL_CATCH_LINESTR2( line ) #line +#define INTERNAL_CATCH_LINESTR( line ) INTERNAL_CATCH_LINESTR2( line ) + +#define INTERNAL_CATCH_GENERATE( expr ) expr.setFileInfo( __FILE__ "(" INTERNAL_CATCH_LINESTR( __LINE__ ) ")" ) + +// #included from: internal/catch_interfaces_exception.h +#define TWOBLUECUBES_CATCH_INTERFACES_EXCEPTION_H_INCLUDED + +#include +#include + +// #included from: catch_interfaces_registry_hub.h +#define TWOBLUECUBES_CATCH_INTERFACES_REGISTRY_HUB_H_INCLUDED + +#include + +namespace Catch { + + class TestCase; + struct ITestCaseRegistry; + struct IExceptionTranslatorRegistry; + struct IExceptionTranslator; + struct IReporterRegistry; + struct IReporterFactory; + struct ITagAliasRegistry; + + struct IRegistryHub { + virtual ~IRegistryHub(); + + virtual IReporterRegistry const& getReporterRegistry() const = 0; + virtual ITestCaseRegistry const& getTestCaseRegistry() const = 0; + virtual ITagAliasRegistry const& getTagAliasRegistry() const = 0; + + virtual IExceptionTranslatorRegistry& getExceptionTranslatorRegistry() = 0; + }; + + struct IMutableRegistryHub { + virtual ~IMutableRegistryHub(); + virtual void registerReporter( std::string const& name, Ptr const& factory ) = 0; + virtual void registerListener( Ptr const& factory ) = 0; + virtual void registerTest( TestCase const& testInfo ) = 0; + virtual void registerTranslator( const IExceptionTranslator* translator ) = 0; + virtual void registerTagAlias( std::string const& alias, std::string const& tag, SourceLineInfo const& lineInfo ) = 0; + }; + + IRegistryHub& getRegistryHub(); + IMutableRegistryHub& getMutableRegistryHub(); + void cleanUp(); + std::string translateActiveException(); + +} + +namespace Catch { + + typedef std::string(*exceptionTranslateFunction)(); + + struct IExceptionTranslator; + typedef std::vector ExceptionTranslators; + + struct IExceptionTranslator { + virtual ~IExceptionTranslator(); + virtual std::string translate( ExceptionTranslators::const_iterator it, ExceptionTranslators::const_iterator itEnd ) const = 0; + }; + + struct IExceptionTranslatorRegistry { + virtual ~IExceptionTranslatorRegistry(); + + virtual std::string translateActiveException() const = 0; + }; + + class ExceptionTranslatorRegistrar { + template + class ExceptionTranslator : public IExceptionTranslator { + public: + + ExceptionTranslator( std::string(*translateFunction)( T& ) ) + : m_translateFunction( translateFunction ) + {} + + virtual std::string translate( ExceptionTranslators::const_iterator it, ExceptionTranslators::const_iterator itEnd ) const CATCH_OVERRIDE { + try { + if( it == itEnd ) + throw; + else + return (*it)->translate( it+1, itEnd ); + } + catch( T& ex ) { + return m_translateFunction( ex ); + } + } + + protected: + std::string(*m_translateFunction)( T& ); + }; + + public: + template + ExceptionTranslatorRegistrar( std::string(*translateFunction)( T& ) ) { + getMutableRegistryHub().registerTranslator + ( new ExceptionTranslator( translateFunction ) ); + } + }; +} + +/////////////////////////////////////////////////////////////////////////////// +#define INTERNAL_CATCH_TRANSLATE_EXCEPTION2( translatorName, signature ) \ + static std::string translatorName( signature ); \ + namespace{ Catch::ExceptionTranslatorRegistrar INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ExceptionRegistrar )( &translatorName ); }\ + static std::string translatorName( signature ) + +#define INTERNAL_CATCH_TRANSLATE_EXCEPTION( signature ) INTERNAL_CATCH_TRANSLATE_EXCEPTION2( INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ExceptionTranslator ), signature ) + +// #included from: internal/catch_approx.hpp +#define TWOBLUECUBES_CATCH_APPROX_HPP_INCLUDED + +#include +#include + +#if defined(CATCH_CONFIG_CPP11_TYPE_TRAITS) +#include +#endif + +namespace Catch { +namespace Detail { + + class Approx { + public: + explicit Approx ( double value ) + : m_epsilon( std::numeric_limits::epsilon()*100 ), + m_margin( 0.0 ), + m_scale( 1.0 ), + m_value( value ) + {} + + static Approx custom() { + return Approx( 0 ); + } + +#if defined(CATCH_CONFIG_CPP11_TYPE_TRAITS) + + template ::value>::type> + Approx operator()( T value ) { + Approx approx( static_cast(value) ); + approx.epsilon( m_epsilon ); + approx.margin( m_margin ); + approx.scale( m_scale ); + return approx; + } + + template ::value>::type> + explicit Approx( T value ): Approx(static_cast(value)) + {} + + template ::value>::type> + friend bool operator == ( const T& lhs, Approx const& rhs ) { + // Thanks to Richard Harris for his help refining this formula + auto lhs_v = double(lhs); + bool relativeOK = std::fabs(lhs_v - rhs.m_value) < rhs.m_epsilon * (rhs.m_scale + (std::max)(std::fabs(lhs_v), std::fabs(rhs.m_value))); + if (relativeOK) { + return true; + } + return std::fabs(lhs_v - rhs.m_value) < rhs.m_margin; + } + + template ::value>::type> + friend bool operator == ( Approx const& lhs, const T& rhs ) { + return operator==( rhs, lhs ); + } + + template ::value>::type> + friend bool operator != ( T lhs, Approx const& rhs ) { + return !operator==( lhs, rhs ); + } + + template ::value>::type> + friend bool operator != ( Approx const& lhs, T rhs ) { + return !operator==( rhs, lhs ); + } + + template ::value>::type> + friend bool operator <= ( T lhs, Approx const& rhs ) { + return double(lhs) < rhs.m_value || lhs == rhs; + } + + template ::value>::type> + friend bool operator <= ( Approx const& lhs, T rhs ) { + return lhs.m_value < double(rhs) || lhs == rhs; + } + + template ::value>::type> + friend bool operator >= ( T lhs, Approx const& rhs ) { + return double(lhs) > rhs.m_value || lhs == rhs; + } + + template ::value>::type> + friend bool operator >= ( Approx const& lhs, T rhs ) { + return lhs.m_value > double(rhs) || lhs == rhs; + } + + template ::value>::type> + Approx& epsilon( T newEpsilon ) { + m_epsilon = double(newEpsilon); + return *this; + } + + template ::value>::type> + Approx& margin( T newMargin ) { + m_margin = double(newMargin); + return *this; + } + + template ::value>::type> + Approx& scale( T newScale ) { + m_scale = double(newScale); + return *this; + } + +#else + + Approx operator()( double value ) { + Approx approx( value ); + approx.epsilon( m_epsilon ); + approx.margin( m_margin ); + approx.scale( m_scale ); + return approx; + } + + friend bool operator == ( double lhs, Approx const& rhs ) { + // Thanks to Richard Harris for his help refining this formula + bool relativeOK = std::fabs( lhs - rhs.m_value ) < rhs.m_epsilon * (rhs.m_scale + (std::max)( std::fabs(lhs), std::fabs(rhs.m_value) ) ); + if (relativeOK) { + return true; + } + return std::fabs(lhs - rhs.m_value) < rhs.m_margin; + } + + friend bool operator == ( Approx const& lhs, double rhs ) { + return operator==( rhs, lhs ); + } + + friend bool operator != ( double lhs, Approx const& rhs ) { + return !operator==( lhs, rhs ); + } + + friend bool operator != ( Approx const& lhs, double rhs ) { + return !operator==( rhs, lhs ); + } + + friend bool operator <= ( double lhs, Approx const& rhs ) { + return lhs < rhs.m_value || lhs == rhs; + } + + friend bool operator <= ( Approx const& lhs, double rhs ) { + return lhs.m_value < rhs || lhs == rhs; + } + + friend bool operator >= ( double lhs, Approx const& rhs ) { + return lhs > rhs.m_value || lhs == rhs; + } + + friend bool operator >= ( Approx const& lhs, double rhs ) { + return lhs.m_value > rhs || lhs == rhs; + } + + Approx& epsilon( double newEpsilon ) { + m_epsilon = newEpsilon; + return *this; + } + + Approx& margin( double newMargin ) { + m_margin = newMargin; + return *this; + } + + Approx& scale( double newScale ) { + m_scale = newScale; + return *this; + } +#endif + + std::string toString() const { + std::ostringstream oss; + oss << "Approx( " << Catch::toString( m_value ) << " )"; + return oss.str(); + } + + private: + double m_epsilon; + double m_margin; + double m_scale; + double m_value; + }; +} + +template<> +inline std::string toString( Detail::Approx const& value ) { + return value.toString(); +} + +} // end namespace Catch + +// #included from: internal/catch_matchers_string.h +#define TWOBLUECUBES_CATCH_MATCHERS_STRING_H_INCLUDED + +namespace Catch { +namespace Matchers { + + namespace StdString { + + struct CasedString + { + CasedString( std::string const& str, CaseSensitive::Choice caseSensitivity ); + std::string adjustString( std::string const& str ) const; + std::string caseSensitivitySuffix() const; + + CaseSensitive::Choice m_caseSensitivity; + std::string m_str; + }; + + struct StringMatcherBase : MatcherBase { + StringMatcherBase( std::string const& operation, CasedString const& comparator ); + virtual std::string describe() const CATCH_OVERRIDE; + + CasedString m_comparator; + std::string m_operation; + }; + + struct EqualsMatcher : StringMatcherBase { + EqualsMatcher( CasedString const& comparator ); + virtual bool match( std::string const& source ) const CATCH_OVERRIDE; + }; + struct ContainsMatcher : StringMatcherBase { + ContainsMatcher( CasedString const& comparator ); + virtual bool match( std::string const& source ) const CATCH_OVERRIDE; + }; + struct StartsWithMatcher : StringMatcherBase { + StartsWithMatcher( CasedString const& comparator ); + virtual bool match( std::string const& source ) const CATCH_OVERRIDE; + }; + struct EndsWithMatcher : StringMatcherBase { + EndsWithMatcher( CasedString const& comparator ); + virtual bool match( std::string const& source ) const CATCH_OVERRIDE; + }; + + } // namespace StdString + + // The following functions create the actual matcher objects. + // This allows the types to be inferred + + StdString::EqualsMatcher Equals( std::string const& str, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes ); + StdString::ContainsMatcher Contains( std::string const& str, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes ); + StdString::EndsWithMatcher EndsWith( std::string const& str, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes ); + StdString::StartsWithMatcher StartsWith( std::string const& str, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes ); + +} // namespace Matchers +} // namespace Catch + +// #included from: internal/catch_matchers_vector.h +#define TWOBLUECUBES_CATCH_MATCHERS_VECTOR_H_INCLUDED + +namespace Catch { +namespace Matchers { + + namespace Vector { + + template + struct ContainsElementMatcher : MatcherBase, T> { + + ContainsElementMatcher(T const &comparator) : m_comparator( comparator) {} + + bool match(std::vector const &v) const CATCH_OVERRIDE { + return std::find(v.begin(), v.end(), m_comparator) != v.end(); + } + + virtual std::string describe() const CATCH_OVERRIDE { + return "Contains: " + Catch::toString( m_comparator ); + } + + T const& m_comparator; + }; + + template + struct ContainsMatcher : MatcherBase, std::vector > { + + ContainsMatcher(std::vector const &comparator) : m_comparator( comparator ) {} + + bool match(std::vector const &v) const CATCH_OVERRIDE { + // !TBD: see note in EqualsMatcher + if (m_comparator.size() > v.size()) + return false; + for (size_t i = 0; i < m_comparator.size(); ++i) + if (std::find(v.begin(), v.end(), m_comparator[i]) == v.end()) + return false; + return true; + } + virtual std::string describe() const CATCH_OVERRIDE { + return "Contains: " + Catch::toString( m_comparator ); + } + + std::vector const& m_comparator; + }; + + template + struct EqualsMatcher : MatcherBase, std::vector > { + + EqualsMatcher(std::vector const &comparator) : m_comparator( comparator ) {} + + bool match(std::vector const &v) const CATCH_OVERRIDE { + // !TBD: This currently works if all elements can be compared using != + // - a more general approach would be via a compare template that defaults + // to using !=. but could be specialised for, e.g. std::vector etc + // - then just call that directly + if (m_comparator.size() != v.size()) + return false; + for (size_t i = 0; i < v.size(); ++i) + if (m_comparator[i] != v[i]) + return false; + return true; + } + virtual std::string describe() const CATCH_OVERRIDE { + return "Equals: " + Catch::toString( m_comparator ); + } + std::vector const& m_comparator; + }; + + } // namespace Vector + + // The following functions create the actual matcher objects. + // This allows the types to be inferred + + template + Vector::ContainsMatcher Contains( std::vector const& comparator ) { + return Vector::ContainsMatcher( comparator ); + } + + template + Vector::ContainsElementMatcher VectorContains( T const& comparator ) { + return Vector::ContainsElementMatcher( comparator ); + } + + template + Vector::EqualsMatcher Equals( std::vector const& comparator ) { + return Vector::EqualsMatcher( comparator ); + } + +} // namespace Matchers +} // namespace Catch + +// #included from: internal/catch_interfaces_tag_alias_registry.h +#define TWOBLUECUBES_CATCH_INTERFACES_TAG_ALIAS_REGISTRY_H_INCLUDED + +// #included from: catch_tag_alias.h +#define TWOBLUECUBES_CATCH_TAG_ALIAS_H_INCLUDED + +#include + +namespace Catch { + + struct TagAlias { + TagAlias( std::string const& _tag, SourceLineInfo _lineInfo ) : tag( _tag ), lineInfo( _lineInfo ) {} + + std::string tag; + SourceLineInfo lineInfo; + }; + + struct RegistrarForTagAliases { + RegistrarForTagAliases( char const* alias, char const* tag, SourceLineInfo const& lineInfo ); + }; + +} // end namespace Catch + +#define CATCH_REGISTER_TAG_ALIAS( alias, spec ) namespace{ Catch::RegistrarForTagAliases INTERNAL_CATCH_UNIQUE_NAME( AutoRegisterTagAlias )( alias, spec, CATCH_INTERNAL_LINEINFO ); } +// #included from: catch_option.hpp +#define TWOBLUECUBES_CATCH_OPTION_HPP_INCLUDED + +namespace Catch { + + // An optional type + template + class Option { + public: + Option() : nullableValue( CATCH_NULL ) {} + Option( T const& _value ) + : nullableValue( new( storage ) T( _value ) ) + {} + Option( Option const& _other ) + : nullableValue( _other ? new( storage ) T( *_other ) : CATCH_NULL ) + {} + + ~Option() { + reset(); + } + + Option& operator= ( Option const& _other ) { + if( &_other != this ) { + reset(); + if( _other ) + nullableValue = new( storage ) T( *_other ); + } + return *this; + } + Option& operator = ( T const& _value ) { + reset(); + nullableValue = new( storage ) T( _value ); + return *this; + } + + void reset() { + if( nullableValue ) + nullableValue->~T(); + nullableValue = CATCH_NULL; + } + + T& operator*() { return *nullableValue; } + T const& operator*() const { return *nullableValue; } + T* operator->() { return nullableValue; } + const T* operator->() const { return nullableValue; } + + T valueOr( T const& defaultValue ) const { + return nullableValue ? *nullableValue : defaultValue; + } + + bool some() const { return nullableValue != CATCH_NULL; } + bool none() const { return nullableValue == CATCH_NULL; } + + bool operator !() const { return nullableValue == CATCH_NULL; } + operator SafeBool::type() const { + return SafeBool::makeSafe( some() ); + } + + private: + T *nullableValue; + union { + char storage[sizeof(T)]; + + // These are here to force alignment for the storage + long double dummy1; + void (*dummy2)(); + long double dummy3; +#ifdef CATCH_CONFIG_CPP11_LONG_LONG + long long dummy4; +#endif + }; + }; + +} // end namespace Catch + +namespace Catch { + + struct ITagAliasRegistry { + virtual ~ITagAliasRegistry(); + virtual Option find( std::string const& alias ) const = 0; + virtual std::string expandAliases( std::string const& unexpandedTestSpec ) const = 0; + + static ITagAliasRegistry const& get(); + }; + +} // end namespace Catch + +// These files are included here so the single_include script doesn't put them +// in the conditionally compiled sections +// #included from: internal/catch_test_case_info.h +#define TWOBLUECUBES_CATCH_TEST_CASE_INFO_H_INCLUDED + +#include +#include + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wpadded" +#endif + +namespace Catch { + + struct ITestCase; + + struct TestCaseInfo { + enum SpecialProperties{ + None = 0, + IsHidden = 1 << 1, + ShouldFail = 1 << 2, + MayFail = 1 << 3, + Throws = 1 << 4, + NonPortable = 1 << 5 + }; + + TestCaseInfo( std::string const& _name, + std::string const& _className, + std::string const& _description, + std::set const& _tags, + SourceLineInfo const& _lineInfo ); + + TestCaseInfo( TestCaseInfo const& other ); + + friend void setTags( TestCaseInfo& testCaseInfo, std::set const& tags ); + + bool isHidden() const; + bool throws() const; + bool okToFail() const; + bool expectedToFail() const; + + std::string name; + std::string className; + std::string description; + std::set tags; + std::set lcaseTags; + std::string tagsAsString; + SourceLineInfo lineInfo; + SpecialProperties properties; + }; + + class TestCase : public TestCaseInfo { + public: + + TestCase( ITestCase* testCase, TestCaseInfo const& info ); + TestCase( TestCase const& other ); + + TestCase withName( std::string const& _newName ) const; + + void invoke() const; + + TestCaseInfo const& getTestCaseInfo() const; + + void swap( TestCase& other ); + bool operator == ( TestCase const& other ) const; + bool operator < ( TestCase const& other ) const; + TestCase& operator = ( TestCase const& other ); + + private: + Ptr test; + }; + + TestCase makeTestCase( ITestCase* testCase, + std::string const& className, + std::string const& name, + std::string const& description, + SourceLineInfo const& lineInfo ); +} + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + + +#ifdef __OBJC__ +// #included from: internal/catch_objc.hpp +#define TWOBLUECUBES_CATCH_OBJC_HPP_INCLUDED + +#import + +#include + +// NB. Any general catch headers included here must be included +// in catch.hpp first to make sure they are included by the single +// header for non obj-usage + +/////////////////////////////////////////////////////////////////////////////// +// This protocol is really only here for (self) documenting purposes, since +// all its methods are optional. +@protocol OcFixture + +@optional + +-(void) setUp; +-(void) tearDown; + +@end + +namespace Catch { + + class OcMethod : public SharedImpl { + + public: + OcMethod( Class cls, SEL sel ) : m_cls( cls ), m_sel( sel ) {} + + virtual void invoke() const { + id obj = [[m_cls alloc] init]; + + performOptionalSelector( obj, @selector(setUp) ); + performOptionalSelector( obj, m_sel ); + performOptionalSelector( obj, @selector(tearDown) ); + + arcSafeRelease( obj ); + } + private: + virtual ~OcMethod() {} + + Class m_cls; + SEL m_sel; + }; + + namespace Detail{ + + inline std::string getAnnotation( Class cls, + std::string const& annotationName, + std::string const& testCaseName ) { + NSString* selStr = [[NSString alloc] initWithFormat:@"Catch_%s_%s", annotationName.c_str(), testCaseName.c_str()]; + SEL sel = NSSelectorFromString( selStr ); + arcSafeRelease( selStr ); + id value = performOptionalSelector( cls, sel ); + if( value ) + return [(NSString*)value UTF8String]; + return ""; + } + } + + inline size_t registerTestMethods() { + size_t noTestMethods = 0; + int noClasses = objc_getClassList( CATCH_NULL, 0 ); + + Class* classes = (CATCH_UNSAFE_UNRETAINED Class *)malloc( sizeof(Class) * noClasses); + objc_getClassList( classes, noClasses ); + + for( int c = 0; c < noClasses; c++ ) { + Class cls = classes[c]; + { + u_int count; + Method* methods = class_copyMethodList( cls, &count ); + for( u_int m = 0; m < count ; m++ ) { + SEL selector = method_getName(methods[m]); + std::string methodName = sel_getName(selector); + if( startsWith( methodName, "Catch_TestCase_" ) ) { + std::string testCaseName = methodName.substr( 15 ); + std::string name = Detail::getAnnotation( cls, "Name", testCaseName ); + std::string desc = Detail::getAnnotation( cls, "Description", testCaseName ); + const char* className = class_getName( cls ); + + getMutableRegistryHub().registerTest( makeTestCase( new OcMethod( cls, selector ), className, name.c_str(), desc.c_str(), SourceLineInfo() ) ); + noTestMethods++; + } + } + free(methods); + } + } + return noTestMethods; + } + + namespace Matchers { + namespace Impl { + namespace NSStringMatchers { + + struct StringHolder : MatcherBase{ + StringHolder( NSString* substr ) : m_substr( [substr copy] ){} + StringHolder( StringHolder const& other ) : m_substr( [other.m_substr copy] ){} + StringHolder() { + arcSafeRelease( m_substr ); + } + + virtual bool match( NSString* arg ) const CATCH_OVERRIDE { + return false; + } + + NSString* m_substr; + }; + + struct Equals : StringHolder { + Equals( NSString* substr ) : StringHolder( substr ){} + + virtual bool match( NSString* str ) const CATCH_OVERRIDE { + return (str != nil || m_substr == nil ) && + [str isEqualToString:m_substr]; + } + + virtual std::string describe() const CATCH_OVERRIDE { + return "equals string: " + Catch::toString( m_substr ); + } + }; + + struct Contains : StringHolder { + Contains( NSString* substr ) : StringHolder( substr ){} + + virtual bool match( NSString* str ) const { + return (str != nil || m_substr == nil ) && + [str rangeOfString:m_substr].location != NSNotFound; + } + + virtual std::string describe() const CATCH_OVERRIDE { + return "contains string: " + Catch::toString( m_substr ); + } + }; + + struct StartsWith : StringHolder { + StartsWith( NSString* substr ) : StringHolder( substr ){} + + virtual bool match( NSString* str ) const { + return (str != nil || m_substr == nil ) && + [str rangeOfString:m_substr].location == 0; + } + + virtual std::string describe() const CATCH_OVERRIDE { + return "starts with: " + Catch::toString( m_substr ); + } + }; + struct EndsWith : StringHolder { + EndsWith( NSString* substr ) : StringHolder( substr ){} + + virtual bool match( NSString* str ) const { + return (str != nil || m_substr == nil ) && + [str rangeOfString:m_substr].location == [str length] - [m_substr length]; + } + + virtual std::string describe() const CATCH_OVERRIDE { + return "ends with: " + Catch::toString( m_substr ); + } + }; + + } // namespace NSStringMatchers + } // namespace Impl + + inline Impl::NSStringMatchers::Equals + Equals( NSString* substr ){ return Impl::NSStringMatchers::Equals( substr ); } + + inline Impl::NSStringMatchers::Contains + Contains( NSString* substr ){ return Impl::NSStringMatchers::Contains( substr ); } + + inline Impl::NSStringMatchers::StartsWith + StartsWith( NSString* substr ){ return Impl::NSStringMatchers::StartsWith( substr ); } + + inline Impl::NSStringMatchers::EndsWith + EndsWith( NSString* substr ){ return Impl::NSStringMatchers::EndsWith( substr ); } + + } // namespace Matchers + + using namespace Matchers; + +} // namespace Catch + +/////////////////////////////////////////////////////////////////////////////// +#define OC_TEST_CASE( name, desc )\ ++(NSString*) INTERNAL_CATCH_UNIQUE_NAME( Catch_Name_test ) \ +{\ +return @ name; \ +}\ ++(NSString*) INTERNAL_CATCH_UNIQUE_NAME( Catch_Description_test ) \ +{ \ +return @ desc; \ +} \ +-(void) INTERNAL_CATCH_UNIQUE_NAME( Catch_TestCase_test ) + +#endif + +#ifdef CATCH_IMPL + +// !TBD: Move the leak detector code into a separate header +#ifdef CATCH_CONFIG_WINDOWS_CRTDBG +#include +class LeakDetector { +public: + LeakDetector() { + int flag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG); + flag |= _CRTDBG_LEAK_CHECK_DF; + flag |= _CRTDBG_ALLOC_MEM_DF; + _CrtSetDbgFlag(flag); + _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG); + _CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR); + // Change this to leaking allocation's number to break there + _CrtSetBreakAlloc(-1); + } +}; +#else +class LeakDetector {}; +#endif + +LeakDetector leakDetector; + +// #included from: internal/catch_impl.hpp +#define TWOBLUECUBES_CATCH_IMPL_HPP_INCLUDED + +// Collect all the implementation files together here +// These are the equivalent of what would usually be cpp files + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wweak-vtables" +#endif + +// #included from: ../catch_session.hpp +#define TWOBLUECUBES_CATCH_RUNNER_HPP_INCLUDED + +// #included from: internal/catch_commandline.hpp +#define TWOBLUECUBES_CATCH_COMMANDLINE_HPP_INCLUDED + +// #included from: catch_config.hpp +#define TWOBLUECUBES_CATCH_CONFIG_HPP_INCLUDED + +// #included from: catch_test_spec_parser.hpp +#define TWOBLUECUBES_CATCH_TEST_SPEC_PARSER_HPP_INCLUDED + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wpadded" +#endif + +// #included from: catch_test_spec.hpp +#define TWOBLUECUBES_CATCH_TEST_SPEC_HPP_INCLUDED + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wpadded" +#endif + +// #included from: catch_wildcard_pattern.hpp +#define TWOBLUECUBES_CATCH_WILDCARD_PATTERN_HPP_INCLUDED + +#include + +namespace Catch +{ + class WildcardPattern { + enum WildcardPosition { + NoWildcard = 0, + WildcardAtStart = 1, + WildcardAtEnd = 2, + WildcardAtBothEnds = WildcardAtStart | WildcardAtEnd + }; + + public: + + WildcardPattern( std::string const& pattern, CaseSensitive::Choice caseSensitivity ) + : m_caseSensitivity( caseSensitivity ), + m_wildcard( NoWildcard ), + m_pattern( adjustCase( pattern ) ) + { + if( startsWith( m_pattern, '*' ) ) { + m_pattern = m_pattern.substr( 1 ); + m_wildcard = WildcardAtStart; + } + if( endsWith( m_pattern, '*' ) ) { + m_pattern = m_pattern.substr( 0, m_pattern.size()-1 ); + m_wildcard = static_cast( m_wildcard | WildcardAtEnd ); + } + } + virtual ~WildcardPattern(); + virtual bool matches( std::string const& str ) const { + switch( m_wildcard ) { + case NoWildcard: + return m_pattern == adjustCase( str ); + case WildcardAtStart: + return endsWith( adjustCase( str ), m_pattern ); + case WildcardAtEnd: + return startsWith( adjustCase( str ), m_pattern ); + case WildcardAtBothEnds: + return contains( adjustCase( str ), m_pattern ); + } + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunreachable-code" +#endif + throw std::logic_error( "Unknown enum" ); +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + } + private: + std::string adjustCase( std::string const& str ) const { + return m_caseSensitivity == CaseSensitive::No ? toLower( str ) : str; + } + CaseSensitive::Choice m_caseSensitivity; + WildcardPosition m_wildcard; + std::string m_pattern; + }; +} + +#include +#include + +namespace Catch { + + class TestSpec { + struct Pattern : SharedImpl<> { + virtual ~Pattern(); + virtual bool matches( TestCaseInfo const& testCase ) const = 0; + }; + class NamePattern : public Pattern { + public: + NamePattern( std::string const& name ) + : m_wildcardPattern( toLower( name ), CaseSensitive::No ) + {} + virtual ~NamePattern(); + virtual bool matches( TestCaseInfo const& testCase ) const { + return m_wildcardPattern.matches( toLower( testCase.name ) ); + } + private: + WildcardPattern m_wildcardPattern; + }; + + class TagPattern : public Pattern { + public: + TagPattern( std::string const& tag ) : m_tag( toLower( tag ) ) {} + virtual ~TagPattern(); + virtual bool matches( TestCaseInfo const& testCase ) const { + return testCase.lcaseTags.find( m_tag ) != testCase.lcaseTags.end(); + } + private: + std::string m_tag; + }; + + class ExcludedPattern : public Pattern { + public: + ExcludedPattern( Ptr const& underlyingPattern ) : m_underlyingPattern( underlyingPattern ) {} + virtual ~ExcludedPattern(); + virtual bool matches( TestCaseInfo const& testCase ) const { return !m_underlyingPattern->matches( testCase ); } + private: + Ptr m_underlyingPattern; + }; + + struct Filter { + std::vector > m_patterns; + + bool matches( TestCaseInfo const& testCase ) const { + // All patterns in a filter must match for the filter to be a match + for( std::vector >::const_iterator it = m_patterns.begin(), itEnd = m_patterns.end(); it != itEnd; ++it ) { + if( !(*it)->matches( testCase ) ) + return false; + } + return true; + } + }; + + public: + bool hasFilters() const { + return !m_filters.empty(); + } + bool matches( TestCaseInfo const& testCase ) const { + // A TestSpec matches if any filter matches + for( std::vector::const_iterator it = m_filters.begin(), itEnd = m_filters.end(); it != itEnd; ++it ) + if( it->matches( testCase ) ) + return true; + return false; + } + + private: + std::vector m_filters; + + friend class TestSpecParser; + }; +} + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + +namespace Catch { + + class TestSpecParser { + enum Mode{ None, Name, QuotedName, Tag, EscapedName }; + Mode m_mode; + bool m_exclusion; + std::size_t m_start, m_pos; + std::string m_arg; + std::vector m_escapeChars; + TestSpec::Filter m_currentFilter; + TestSpec m_testSpec; + ITagAliasRegistry const* m_tagAliases; + + public: + TestSpecParser( ITagAliasRegistry const& tagAliases ) :m_mode(None), m_exclusion(false), m_start(0), m_pos(0), m_tagAliases( &tagAliases ) {} + + TestSpecParser& parse( std::string const& arg ) { + m_mode = None; + m_exclusion = false; + m_start = std::string::npos; + m_arg = m_tagAliases->expandAliases( arg ); + m_escapeChars.clear(); + for( m_pos = 0; m_pos < m_arg.size(); ++m_pos ) + visitChar( m_arg[m_pos] ); + if( m_mode == Name ) + addPattern(); + return *this; + } + TestSpec testSpec() { + addFilter(); + return m_testSpec; + } + private: + void visitChar( char c ) { + if( m_mode == None ) { + switch( c ) { + case ' ': return; + case '~': m_exclusion = true; return; + case '[': return startNewMode( Tag, ++m_pos ); + case '"': return startNewMode( QuotedName, ++m_pos ); + case '\\': return escape(); + default: startNewMode( Name, m_pos ); break; + } + } + if( m_mode == Name ) { + if( c == ',' ) { + addPattern(); + addFilter(); + } + else if( c == '[' ) { + if( subString() == "exclude:" ) + m_exclusion = true; + else + addPattern(); + startNewMode( Tag, ++m_pos ); + } + else if( c == '\\' ) + escape(); + } + else if( m_mode == EscapedName ) + m_mode = Name; + else if( m_mode == QuotedName && c == '"' ) + addPattern(); + else if( m_mode == Tag && c == ']' ) + addPattern(); + } + void startNewMode( Mode mode, std::size_t start ) { + m_mode = mode; + m_start = start; + } + void escape() { + if( m_mode == None ) + m_start = m_pos; + m_mode = EscapedName; + m_escapeChars.push_back( m_pos ); + } + std::string subString() const { return m_arg.substr( m_start, m_pos - m_start ); } + template + void addPattern() { + std::string token = subString(); + for( size_t i = 0; i < m_escapeChars.size(); ++i ) + token = token.substr( 0, m_escapeChars[i]-m_start-i ) + token.substr( m_escapeChars[i]-m_start-i+1 ); + m_escapeChars.clear(); + if( startsWith( token, "exclude:" ) ) { + m_exclusion = true; + token = token.substr( 8 ); + } + if( !token.empty() ) { + Ptr pattern = new T( token ); + if( m_exclusion ) + pattern = new TestSpec::ExcludedPattern( pattern ); + m_currentFilter.m_patterns.push_back( pattern ); + } + m_exclusion = false; + m_mode = None; + } + void addFilter() { + if( !m_currentFilter.m_patterns.empty() ) { + m_testSpec.m_filters.push_back( m_currentFilter ); + m_currentFilter = TestSpec::Filter(); + } + } + }; + inline TestSpec parseTestSpec( std::string const& arg ) { + return TestSpecParser( ITagAliasRegistry::get() ).parse( arg ).testSpec(); + } + +} // namespace Catch + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + +// #included from: catch_interfaces_config.h +#define TWOBLUECUBES_CATCH_INTERFACES_CONFIG_H_INCLUDED + +#include +#include +#include + +namespace Catch { + + struct Verbosity { enum Level { + NoOutput = 0, + Quiet, + Normal + }; }; + + struct WarnAbout { enum What { + Nothing = 0x00, + NoAssertions = 0x01 + }; }; + + struct ShowDurations { enum OrNot { + DefaultForReporter, + Always, + Never + }; }; + struct RunTests { enum InWhatOrder { + InDeclarationOrder, + InLexicographicalOrder, + InRandomOrder + }; }; + struct UseColour { enum YesOrNo { + Auto, + Yes, + No + }; }; + struct WaitForKeypress { enum When { + Never, + BeforeStart = 1, + BeforeExit = 2, + BeforeStartAndExit = BeforeStart | BeforeExit + }; }; + + class TestSpec; + + struct IConfig : IShared { + + virtual ~IConfig(); + + virtual bool allowThrows() const = 0; + virtual std::ostream& stream() const = 0; + virtual std::string name() const = 0; + virtual bool includeSuccessfulResults() const = 0; + virtual bool shouldDebugBreak() const = 0; + virtual bool warnAboutMissingAssertions() const = 0; + virtual int abortAfter() const = 0; + virtual bool showInvisibles() const = 0; + virtual ShowDurations::OrNot showDurations() const = 0; + virtual TestSpec const& testSpec() const = 0; + virtual RunTests::InWhatOrder runOrder() const = 0; + virtual unsigned int rngSeed() const = 0; + virtual UseColour::YesOrNo useColour() const = 0; + virtual std::vector const& getSectionsToRun() const = 0; + + }; +} + +// #included from: catch_stream.h +#define TWOBLUECUBES_CATCH_STREAM_H_INCLUDED + +// #included from: catch_streambuf.h +#define TWOBLUECUBES_CATCH_STREAMBUF_H_INCLUDED + +#include + +namespace Catch { + + class StreamBufBase : public std::streambuf { + public: + virtual ~StreamBufBase() CATCH_NOEXCEPT; + }; +} + +#include +#include +#include +#include + +namespace Catch { + + std::ostream& cout(); + std::ostream& cerr(); + std::ostream& clog(); + + struct IStream { + virtual ~IStream() CATCH_NOEXCEPT; + virtual std::ostream& stream() const = 0; + }; + + class FileStream : public IStream { + mutable std::ofstream m_ofs; + public: + FileStream( std::string const& filename ); + virtual ~FileStream() CATCH_NOEXCEPT; + public: // IStream + virtual std::ostream& stream() const CATCH_OVERRIDE; + }; + + class CoutStream : public IStream { + mutable std::ostream m_os; + public: + CoutStream(); + virtual ~CoutStream() CATCH_NOEXCEPT; + + public: // IStream + virtual std::ostream& stream() const CATCH_OVERRIDE; + }; + + class DebugOutStream : public IStream { + CATCH_AUTO_PTR( StreamBufBase ) m_streamBuf; + mutable std::ostream m_os; + public: + DebugOutStream(); + virtual ~DebugOutStream() CATCH_NOEXCEPT; + + public: // IStream + virtual std::ostream& stream() const CATCH_OVERRIDE; + }; +} + +#include +#include +#include +#include + +#ifndef CATCH_CONFIG_CONSOLE_WIDTH +#define CATCH_CONFIG_CONSOLE_WIDTH 80 +#endif + +namespace Catch { + + struct ConfigData { + + ConfigData() + : listTests( false ), + listTags( false ), + listReporters( false ), + listTestNamesOnly( false ), + listExtraInfo( false ), + showSuccessfulTests( false ), + shouldDebugBreak( false ), + noThrow( false ), + showHelp( false ), + showInvisibles( false ), + filenamesAsTags( false ), + libIdentify( false ), + abortAfter( -1 ), + rngSeed( 0 ), + verbosity( Verbosity::Normal ), + warnings( WarnAbout::Nothing ), + showDurations( ShowDurations::DefaultForReporter ), + runOrder( RunTests::InDeclarationOrder ), + useColour( UseColour::Auto ), + waitForKeypress( WaitForKeypress::Never ) + {} + + bool listTests; + bool listTags; + bool listReporters; + bool listTestNamesOnly; + bool listExtraInfo; + + bool showSuccessfulTests; + bool shouldDebugBreak; + bool noThrow; + bool showHelp; + bool showInvisibles; + bool filenamesAsTags; + bool libIdentify; + + int abortAfter; + unsigned int rngSeed; + + Verbosity::Level verbosity; + WarnAbout::What warnings; + ShowDurations::OrNot showDurations; + RunTests::InWhatOrder runOrder; + UseColour::YesOrNo useColour; + WaitForKeypress::When waitForKeypress; + + std::string outputFilename; + std::string name; + std::string processName; + + std::vector reporterNames; + std::vector testsOrTags; + std::vector sectionsToRun; + }; + + class Config : public SharedImpl { + private: + Config( Config const& other ); + Config& operator = ( Config const& other ); + virtual void dummy(); + public: + + Config() + {} + + Config( ConfigData const& data ) + : m_data( data ), + m_stream( openStream() ) + { + if( !data.testsOrTags.empty() ) { + TestSpecParser parser( ITagAliasRegistry::get() ); + for( std::size_t i = 0; i < data.testsOrTags.size(); ++i ) + parser.parse( data.testsOrTags[i] ); + m_testSpec = parser.testSpec(); + } + } + + virtual ~Config() {} + + std::string const& getFilename() const { + return m_data.outputFilename ; + } + + bool listTests() const { return m_data.listTests; } + bool listTestNamesOnly() const { return m_data.listTestNamesOnly; } + bool listTags() const { return m_data.listTags; } + bool listReporters() const { return m_data.listReporters; } + bool listExtraInfo() const { return m_data.listExtraInfo; } + + std::string getProcessName() const { return m_data.processName; } + + std::vector const& getReporterNames() const { return m_data.reporterNames; } + std::vector const& getSectionsToRun() const CATCH_OVERRIDE { return m_data.sectionsToRun; } + + virtual TestSpec const& testSpec() const CATCH_OVERRIDE { return m_testSpec; } + + bool showHelp() const { return m_data.showHelp; } + + // IConfig interface + virtual bool allowThrows() const CATCH_OVERRIDE { return !m_data.noThrow; } + virtual std::ostream& stream() const CATCH_OVERRIDE { return m_stream->stream(); } + virtual std::string name() const CATCH_OVERRIDE { return m_data.name.empty() ? m_data.processName : m_data.name; } + virtual bool includeSuccessfulResults() const CATCH_OVERRIDE { return m_data.showSuccessfulTests; } + virtual bool warnAboutMissingAssertions() const CATCH_OVERRIDE { return m_data.warnings & WarnAbout::NoAssertions; } + virtual ShowDurations::OrNot showDurations() const CATCH_OVERRIDE { return m_data.showDurations; } + virtual RunTests::InWhatOrder runOrder() const CATCH_OVERRIDE { return m_data.runOrder; } + virtual unsigned int rngSeed() const CATCH_OVERRIDE { return m_data.rngSeed; } + virtual UseColour::YesOrNo useColour() const CATCH_OVERRIDE { return m_data.useColour; } + virtual bool shouldDebugBreak() const CATCH_OVERRIDE { return m_data.shouldDebugBreak; } + virtual int abortAfter() const CATCH_OVERRIDE { return m_data.abortAfter; } + virtual bool showInvisibles() const CATCH_OVERRIDE { return m_data.showInvisibles; } + + private: + + IStream const* openStream() { + if( m_data.outputFilename.empty() ) + return new CoutStream(); + else if( m_data.outputFilename[0] == '%' ) { + if( m_data.outputFilename == "%debug" ) + return new DebugOutStream(); + else + throw std::domain_error( "Unrecognised stream: " + m_data.outputFilename ); + } + else + return new FileStream( m_data.outputFilename ); + } + ConfigData m_data; + + CATCH_AUTO_PTR( IStream const ) m_stream; + TestSpec m_testSpec; + }; + +} // end namespace Catch + +// #included from: catch_clara.h +#define TWOBLUECUBES_CATCH_CLARA_H_INCLUDED + +// Use Catch's value for console width (store Clara's off to the side, if present) +#ifdef CLARA_CONFIG_CONSOLE_WIDTH +#define CATCH_TEMP_CLARA_CONFIG_CONSOLE_WIDTH CLARA_CONFIG_CONSOLE_WIDTH +#undef CLARA_CONFIG_CONSOLE_WIDTH +#endif +#define CLARA_CONFIG_CONSOLE_WIDTH CATCH_CONFIG_CONSOLE_WIDTH + +// Declare Clara inside the Catch namespace +#define STITCH_CLARA_OPEN_NAMESPACE namespace Catch { +// #included from: ../external/clara.h + +// Version 0.0.2.4 + +// Only use header guard if we are not using an outer namespace +#if !defined(TWOBLUECUBES_CLARA_H_INCLUDED) || defined(STITCH_CLARA_OPEN_NAMESPACE) + +#ifndef STITCH_CLARA_OPEN_NAMESPACE +#define TWOBLUECUBES_CLARA_H_INCLUDED +#define STITCH_CLARA_OPEN_NAMESPACE +#define STITCH_CLARA_CLOSE_NAMESPACE +#else +#define STITCH_CLARA_CLOSE_NAMESPACE } +#endif + +#define STITCH_TBC_TEXT_FORMAT_OPEN_NAMESPACE STITCH_CLARA_OPEN_NAMESPACE + +// ----------- #included from tbc_text_format.h ----------- + +// Only use header guard if we are not using an outer namespace +#if !defined(TBC_TEXT_FORMAT_H_INCLUDED) || defined(STITCH_TBC_TEXT_FORMAT_OUTER_NAMESPACE) +#ifndef STITCH_TBC_TEXT_FORMAT_OUTER_NAMESPACE +#define TBC_TEXT_FORMAT_H_INCLUDED +#endif + +#include +#include +#include +#include +#include + +// Use optional outer namespace +#ifdef STITCH_TBC_TEXT_FORMAT_OUTER_NAMESPACE +namespace STITCH_TBC_TEXT_FORMAT_OUTER_NAMESPACE { +#endif + +namespace Tbc { + +#ifdef TBC_TEXT_FORMAT_CONSOLE_WIDTH + const unsigned int consoleWidth = TBC_TEXT_FORMAT_CONSOLE_WIDTH; +#else + const unsigned int consoleWidth = 80; +#endif + + struct TextAttributes { + TextAttributes() + : initialIndent( std::string::npos ), + indent( 0 ), + width( consoleWidth-1 ), + tabChar( '\t' ) + {} + + TextAttributes& setInitialIndent( std::size_t _value ) { initialIndent = _value; return *this; } + TextAttributes& setIndent( std::size_t _value ) { indent = _value; return *this; } + TextAttributes& setWidth( std::size_t _value ) { width = _value; return *this; } + TextAttributes& setTabChar( char _value ) { tabChar = _value; return *this; } + + std::size_t initialIndent; // indent of first line, or npos + std::size_t indent; // indent of subsequent lines, or all if initialIndent is npos + std::size_t width; // maximum width of text, including indent. Longer text will wrap + char tabChar; // If this char is seen the indent is changed to current pos + }; + + class Text { + public: + Text( std::string const& _str, TextAttributes const& _attr = TextAttributes() ) + : attr( _attr ) + { + std::string wrappableChars = " [({.,/|\\-"; + std::size_t indent = _attr.initialIndent != std::string::npos + ? _attr.initialIndent + : _attr.indent; + std::string remainder = _str; + + while( !remainder.empty() ) { + if( lines.size() >= 1000 ) { + lines.push_back( "... message truncated due to excessive size" ); + return; + } + std::size_t tabPos = std::string::npos; + std::size_t width = (std::min)( remainder.size(), _attr.width - indent ); + std::size_t pos = remainder.find_first_of( '\n' ); + if( pos <= width ) { + width = pos; + } + pos = remainder.find_last_of( _attr.tabChar, width ); + if( pos != std::string::npos ) { + tabPos = pos; + if( remainder[width] == '\n' ) + width--; + remainder = remainder.substr( 0, tabPos ) + remainder.substr( tabPos+1 ); + } + + if( width == remainder.size() ) { + spliceLine( indent, remainder, width ); + } + else if( remainder[width] == '\n' ) { + spliceLine( indent, remainder, width ); + if( width <= 1 || remainder.size() != 1 ) + remainder = remainder.substr( 1 ); + indent = _attr.indent; + } + else { + pos = remainder.find_last_of( wrappableChars, width ); + if( pos != std::string::npos && pos > 0 ) { + spliceLine( indent, remainder, pos ); + if( remainder[0] == ' ' ) + remainder = remainder.substr( 1 ); + } + else { + spliceLine( indent, remainder, width-1 ); + lines.back() += "-"; + } + if( lines.size() == 1 ) + indent = _attr.indent; + if( tabPos != std::string::npos ) + indent += tabPos; + } + } + } + + void spliceLine( std::size_t _indent, std::string& _remainder, std::size_t _pos ) { + lines.push_back( std::string( _indent, ' ' ) + _remainder.substr( 0, _pos ) ); + _remainder = _remainder.substr( _pos ); + } + + typedef std::vector::const_iterator const_iterator; + + const_iterator begin() const { return lines.begin(); } + const_iterator end() const { return lines.end(); } + std::string const& last() const { return lines.back(); } + std::size_t size() const { return lines.size(); } + std::string const& operator[]( std::size_t _index ) const { return lines[_index]; } + std::string toString() const { + std::ostringstream oss; + oss << *this; + return oss.str(); + } + + friend std::ostream& operator << ( std::ostream& _stream, Text const& _text ) { + for( Text::const_iterator it = _text.begin(), itEnd = _text.end(); + it != itEnd; ++it ) { + if( it != _text.begin() ) + _stream << "\n"; + _stream << *it; + } + return _stream; + } + + private: + std::string str; + TextAttributes attr; + std::vector lines; + }; + +} // end namespace Tbc + +#ifdef STITCH_TBC_TEXT_FORMAT_OUTER_NAMESPACE +} // end outer namespace +#endif + +#endif // TBC_TEXT_FORMAT_H_INCLUDED + +// ----------- end of #include from tbc_text_format.h ----------- +// ........... back in clara.h + +#undef STITCH_TBC_TEXT_FORMAT_OPEN_NAMESPACE + +// ----------- #included from clara_compilers.h ----------- + +#ifndef TWOBLUECUBES_CLARA_COMPILERS_H_INCLUDED +#define TWOBLUECUBES_CLARA_COMPILERS_H_INCLUDED + +// Detect a number of compiler features - mostly C++11/14 conformance - by compiler +// The following features are defined: +// +// CLARA_CONFIG_CPP11_NULLPTR : is nullptr supported? +// CLARA_CONFIG_CPP11_NOEXCEPT : is noexcept supported? +// CLARA_CONFIG_CPP11_GENERATED_METHODS : The delete and default keywords for compiler generated methods +// CLARA_CONFIG_CPP11_OVERRIDE : is override supported? +// CLARA_CONFIG_CPP11_UNIQUE_PTR : is unique_ptr supported (otherwise use auto_ptr) + +// CLARA_CONFIG_CPP11_OR_GREATER : Is C++11 supported? + +// CLARA_CONFIG_VARIADIC_MACROS : are variadic macros supported? + +// In general each macro has a _NO_ form +// (e.g. CLARA_CONFIG_CPP11_NO_NULLPTR) which disables the feature. +// Many features, at point of detection, define an _INTERNAL_ macro, so they +// can be combined, en-mass, with the _NO_ forms later. + +// All the C++11 features can be disabled with CLARA_CONFIG_NO_CPP11 + +#ifdef __clang__ + +#if __has_feature(cxx_nullptr) +#define CLARA_INTERNAL_CONFIG_CPP11_NULLPTR +#endif + +#if __has_feature(cxx_noexcept) +#define CLARA_INTERNAL_CONFIG_CPP11_NOEXCEPT +#endif + +#endif // __clang__ + +//////////////////////////////////////////////////////////////////////////////// +// GCC +#ifdef __GNUC__ + +#if __GNUC__ == 4 && __GNUC_MINOR__ >= 6 && defined(__GXX_EXPERIMENTAL_CXX0X__) +#define CLARA_INTERNAL_CONFIG_CPP11_NULLPTR +#endif + +// - otherwise more recent versions define __cplusplus >= 201103L +// and will get picked up below + +#endif // __GNUC__ + +//////////////////////////////////////////////////////////////////////////////// +// Visual C++ +#ifdef _MSC_VER + +#if (_MSC_VER >= 1600) +#define CLARA_INTERNAL_CONFIG_CPP11_NULLPTR +#define CLARA_INTERNAL_CONFIG_CPP11_UNIQUE_PTR +#endif + +#if (_MSC_VER >= 1900 ) // (VC++ 13 (VS2015)) +#define CLARA_INTERNAL_CONFIG_CPP11_NOEXCEPT +#define CLARA_INTERNAL_CONFIG_CPP11_GENERATED_METHODS +#endif + +#endif // _MSC_VER + +//////////////////////////////////////////////////////////////////////////////// +// C++ language feature support + +// catch all support for C++11 +#if defined(__cplusplus) && __cplusplus >= 201103L + +#define CLARA_CPP11_OR_GREATER + +#if !defined(CLARA_INTERNAL_CONFIG_CPP11_NULLPTR) +#define CLARA_INTERNAL_CONFIG_CPP11_NULLPTR +#endif + +#ifndef CLARA_INTERNAL_CONFIG_CPP11_NOEXCEPT +#define CLARA_INTERNAL_CONFIG_CPP11_NOEXCEPT +#endif + +#ifndef CLARA_INTERNAL_CONFIG_CPP11_GENERATED_METHODS +#define CLARA_INTERNAL_CONFIG_CPP11_GENERATED_METHODS +#endif + +#if !defined(CLARA_INTERNAL_CONFIG_CPP11_OVERRIDE) +#define CLARA_INTERNAL_CONFIG_CPP11_OVERRIDE +#endif +#if !defined(CLARA_INTERNAL_CONFIG_CPP11_UNIQUE_PTR) +#define CLARA_INTERNAL_CONFIG_CPP11_UNIQUE_PTR +#endif + +#endif // __cplusplus >= 201103L + +// Now set the actual defines based on the above + anything the user has configured +#if defined(CLARA_INTERNAL_CONFIG_CPP11_NULLPTR) && !defined(CLARA_CONFIG_CPP11_NO_NULLPTR) && !defined(CLARA_CONFIG_CPP11_NULLPTR) && !defined(CLARA_CONFIG_NO_CPP11) +#define CLARA_CONFIG_CPP11_NULLPTR +#endif +#if defined(CLARA_INTERNAL_CONFIG_CPP11_NOEXCEPT) && !defined(CLARA_CONFIG_CPP11_NO_NOEXCEPT) && !defined(CLARA_CONFIG_CPP11_NOEXCEPT) && !defined(CLARA_CONFIG_NO_CPP11) +#define CLARA_CONFIG_CPP11_NOEXCEPT +#endif +#if defined(CLARA_INTERNAL_CONFIG_CPP11_GENERATED_METHODS) && !defined(CLARA_CONFIG_CPP11_NO_GENERATED_METHODS) && !defined(CLARA_CONFIG_CPP11_GENERATED_METHODS) && !defined(CLARA_CONFIG_NO_CPP11) +#define CLARA_CONFIG_CPP11_GENERATED_METHODS +#endif +#if defined(CLARA_INTERNAL_CONFIG_CPP11_OVERRIDE) && !defined(CLARA_CONFIG_NO_OVERRIDE) && !defined(CLARA_CONFIG_CPP11_OVERRIDE) && !defined(CLARA_CONFIG_NO_CPP11) +#define CLARA_CONFIG_CPP11_OVERRIDE +#endif +#if defined(CLARA_INTERNAL_CONFIG_CPP11_UNIQUE_PTR) && !defined(CLARA_CONFIG_NO_UNIQUE_PTR) && !defined(CLARA_CONFIG_CPP11_UNIQUE_PTR) && !defined(CLARA_CONFIG_NO_CPP11) +#define CLARA_CONFIG_CPP11_UNIQUE_PTR +#endif + +// noexcept support: +#if defined(CLARA_CONFIG_CPP11_NOEXCEPT) && !defined(CLARA_NOEXCEPT) +#define CLARA_NOEXCEPT noexcept +# define CLARA_NOEXCEPT_IS(x) noexcept(x) +#else +#define CLARA_NOEXCEPT throw() +# define CLARA_NOEXCEPT_IS(x) +#endif + +// nullptr support +#ifdef CLARA_CONFIG_CPP11_NULLPTR +#define CLARA_NULL nullptr +#else +#define CLARA_NULL NULL +#endif + +// override support +#ifdef CLARA_CONFIG_CPP11_OVERRIDE +#define CLARA_OVERRIDE override +#else +#define CLARA_OVERRIDE +#endif + +// unique_ptr support +#ifdef CLARA_CONFIG_CPP11_UNIQUE_PTR +# define CLARA_AUTO_PTR( T ) std::unique_ptr +#else +# define CLARA_AUTO_PTR( T ) std::auto_ptr +#endif + +#endif // TWOBLUECUBES_CLARA_COMPILERS_H_INCLUDED + +// ----------- end of #include from clara_compilers.h ----------- +// ........... back in clara.h + +#include +#include +#include + +#if defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER) +#define CLARA_PLATFORM_WINDOWS +#endif + +// Use optional outer namespace +#ifdef STITCH_CLARA_OPEN_NAMESPACE +STITCH_CLARA_OPEN_NAMESPACE +#endif + +namespace Clara { + + struct UnpositionalTag {}; + + extern UnpositionalTag _; + +#ifdef CLARA_CONFIG_MAIN + UnpositionalTag _; +#endif + + namespace Detail { + +#ifdef CLARA_CONSOLE_WIDTH + const unsigned int consoleWidth = CLARA_CONFIG_CONSOLE_WIDTH; +#else + const unsigned int consoleWidth = 80; +#endif + + using namespace Tbc; + + inline bool startsWith( std::string const& str, std::string const& prefix ) { + return str.size() >= prefix.size() && str.substr( 0, prefix.size() ) == prefix; + } + + template struct RemoveConstRef{ typedef T type; }; + template struct RemoveConstRef{ typedef T type; }; + template struct RemoveConstRef{ typedef T type; }; + template struct RemoveConstRef{ typedef T type; }; + + template struct IsBool { static const bool value = false; }; + template<> struct IsBool { static const bool value = true; }; + + template + void convertInto( std::string const& _source, T& _dest ) { + std::stringstream ss; + ss << _source; + ss >> _dest; + if( ss.fail() ) + throw std::runtime_error( "Unable to convert " + _source + " to destination type" ); + } + inline void convertInto( std::string const& _source, std::string& _dest ) { + _dest = _source; + } + char toLowerCh(char c) { + return static_cast( std::tolower( c ) ); + } + inline void convertInto( std::string const& _source, bool& _dest ) { + std::string sourceLC = _source; + std::transform( sourceLC.begin(), sourceLC.end(), sourceLC.begin(), toLowerCh ); + if( sourceLC == "y" || sourceLC == "1" || sourceLC == "true" || sourceLC == "yes" || sourceLC == "on" ) + _dest = true; + else if( sourceLC == "n" || sourceLC == "0" || sourceLC == "false" || sourceLC == "no" || sourceLC == "off" ) + _dest = false; + else + throw std::runtime_error( "Expected a boolean value but did not recognise:\n '" + _source + "'" ); + } + + template + struct IArgFunction { + virtual ~IArgFunction() {} +#ifdef CLARA_CONFIG_CPP11_GENERATED_METHODS + IArgFunction() = default; + IArgFunction( IArgFunction const& ) = default; +#endif + virtual void set( ConfigT& config, std::string const& value ) const = 0; + virtual bool takesArg() const = 0; + virtual IArgFunction* clone() const = 0; + }; + + template + class BoundArgFunction { + public: + BoundArgFunction() : functionObj( CLARA_NULL ) {} + BoundArgFunction( IArgFunction* _functionObj ) : functionObj( _functionObj ) {} + BoundArgFunction( BoundArgFunction const& other ) : functionObj( other.functionObj ? other.functionObj->clone() : CLARA_NULL ) {} + BoundArgFunction& operator = ( BoundArgFunction const& other ) { + IArgFunction* newFunctionObj = other.functionObj ? other.functionObj->clone() : CLARA_NULL; + delete functionObj; + functionObj = newFunctionObj; + return *this; + } + ~BoundArgFunction() { delete functionObj; } + + void set( ConfigT& config, std::string const& value ) const { + functionObj->set( config, value ); + } + bool takesArg() const { return functionObj->takesArg(); } + + bool isSet() const { + return functionObj != CLARA_NULL; + } + private: + IArgFunction* functionObj; + }; + + template + struct NullBinder : IArgFunction{ + virtual void set( C&, std::string const& ) const {} + virtual bool takesArg() const { return true; } + virtual IArgFunction* clone() const { return new NullBinder( *this ); } + }; + + template + struct BoundDataMember : IArgFunction{ + BoundDataMember( M C::* _member ) : member( _member ) {} + virtual void set( C& p, std::string const& stringValue ) const { + convertInto( stringValue, p.*member ); + } + virtual bool takesArg() const { return !IsBool::value; } + virtual IArgFunction* clone() const { return new BoundDataMember( *this ); } + M C::* member; + }; + template + struct BoundUnaryMethod : IArgFunction{ + BoundUnaryMethod( void (C::*_member)( M ) ) : member( _member ) {} + virtual void set( C& p, std::string const& stringValue ) const { + typename RemoveConstRef::type value; + convertInto( stringValue, value ); + (p.*member)( value ); + } + virtual bool takesArg() const { return !IsBool::value; } + virtual IArgFunction* clone() const { return new BoundUnaryMethod( *this ); } + void (C::*member)( M ); + }; + template + struct BoundNullaryMethod : IArgFunction{ + BoundNullaryMethod( void (C::*_member)() ) : member( _member ) {} + virtual void set( C& p, std::string const& stringValue ) const { + bool value; + convertInto( stringValue, value ); + if( value ) + (p.*member)(); + } + virtual bool takesArg() const { return false; } + virtual IArgFunction* clone() const { return new BoundNullaryMethod( *this ); } + void (C::*member)(); + }; + + template + struct BoundUnaryFunction : IArgFunction{ + BoundUnaryFunction( void (*_function)( C& ) ) : function( _function ) {} + virtual void set( C& obj, std::string const& stringValue ) const { + bool value; + convertInto( stringValue, value ); + if( value ) + function( obj ); + } + virtual bool takesArg() const { return false; } + virtual IArgFunction* clone() const { return new BoundUnaryFunction( *this ); } + void (*function)( C& ); + }; + + template + struct BoundBinaryFunction : IArgFunction{ + BoundBinaryFunction( void (*_function)( C&, T ) ) : function( _function ) {} + virtual void set( C& obj, std::string const& stringValue ) const { + typename RemoveConstRef::type value; + convertInto( stringValue, value ); + function( obj, value ); + } + virtual bool takesArg() const { return !IsBool::value; } + virtual IArgFunction* clone() const { return new BoundBinaryFunction( *this ); } + void (*function)( C&, T ); + }; + + } // namespace Detail + + inline std::vector argsToVector( int argc, char const* const* const argv ) { + std::vector args( static_cast( argc ) ); + for( std::size_t i = 0; i < static_cast( argc ); ++i ) + args[i] = argv[i]; + + return args; + } + + class Parser { + enum Mode { None, MaybeShortOpt, SlashOpt, ShortOpt, LongOpt, Positional }; + Mode mode; + std::size_t from; + bool inQuotes; + public: + + struct Token { + enum Type { Positional, ShortOpt, LongOpt }; + Token( Type _type, std::string const& _data ) : type( _type ), data( _data ) {} + Type type; + std::string data; + }; + + Parser() : mode( None ), from( 0 ), inQuotes( false ){} + + void parseIntoTokens( std::vector const& args, std::vector& tokens ) { + const std::string doubleDash = "--"; + for( std::size_t i = 1; i < args.size() && args[i] != doubleDash; ++i ) + parseIntoTokens( args[i], tokens); + } + + void parseIntoTokens( std::string const& arg, std::vector& tokens ) { + for( std::size_t i = 0; i < arg.size(); ++i ) { + char c = arg[i]; + if( c == '"' ) + inQuotes = !inQuotes; + mode = handleMode( i, c, arg, tokens ); + } + mode = handleMode( arg.size(), '\0', arg, tokens ); + } + Mode handleMode( std::size_t i, char c, std::string const& arg, std::vector& tokens ) { + switch( mode ) { + case None: return handleNone( i, c ); + case MaybeShortOpt: return handleMaybeShortOpt( i, c ); + case ShortOpt: + case LongOpt: + case SlashOpt: return handleOpt( i, c, arg, tokens ); + case Positional: return handlePositional( i, c, arg, tokens ); + default: throw std::logic_error( "Unknown mode" ); + } + } + + Mode handleNone( std::size_t i, char c ) { + if( inQuotes ) { + from = i; + return Positional; + } + switch( c ) { + case '-': return MaybeShortOpt; +#ifdef CLARA_PLATFORM_WINDOWS + case '/': from = i+1; return SlashOpt; +#endif + default: from = i; return Positional; + } + } + Mode handleMaybeShortOpt( std::size_t i, char c ) { + switch( c ) { + case '-': from = i+1; return LongOpt; + default: from = i; return ShortOpt; + } + } + + Mode handleOpt( std::size_t i, char c, std::string const& arg, std::vector& tokens ) { + if( std::string( ":=\0", 3 ).find( c ) == std::string::npos ) + return mode; + + std::string optName = arg.substr( from, i-from ); + if( mode == ShortOpt ) + for( std::size_t j = 0; j < optName.size(); ++j ) + tokens.push_back( Token( Token::ShortOpt, optName.substr( j, 1 ) ) ); + else if( mode == SlashOpt && optName.size() == 1 ) + tokens.push_back( Token( Token::ShortOpt, optName ) ); + else + tokens.push_back( Token( Token::LongOpt, optName ) ); + return None; + } + Mode handlePositional( std::size_t i, char c, std::string const& arg, std::vector& tokens ) { + if( inQuotes || std::string( "\0", 1 ).find( c ) == std::string::npos ) + return mode; + + std::string data = arg.substr( from, i-from ); + tokens.push_back( Token( Token::Positional, data ) ); + return None; + } + }; + + template + struct CommonArgProperties { + CommonArgProperties() {} + CommonArgProperties( Detail::BoundArgFunction const& _boundField ) : boundField( _boundField ) {} + + Detail::BoundArgFunction boundField; + std::string description; + std::string detail; + std::string placeholder; // Only value if boundField takes an arg + + bool takesArg() const { + return !placeholder.empty(); + } + void validate() const { + if( !boundField.isSet() ) + throw std::logic_error( "option not bound" ); + } + }; + struct OptionArgProperties { + std::vector shortNames; + std::string longName; + + bool hasShortName( std::string const& shortName ) const { + return std::find( shortNames.begin(), shortNames.end(), shortName ) != shortNames.end(); + } + bool hasLongName( std::string const& _longName ) const { + return _longName == longName; + } + }; + struct PositionalArgProperties { + PositionalArgProperties() : position( -1 ) {} + int position; // -1 means non-positional (floating) + + bool isFixedPositional() const { + return position != -1; + } + }; + + template + class CommandLine { + + struct Arg : CommonArgProperties, OptionArgProperties, PositionalArgProperties { + Arg() {} + Arg( Detail::BoundArgFunction const& _boundField ) : CommonArgProperties( _boundField ) {} + + using CommonArgProperties::placeholder; // !TBD + + std::string dbgName() const { + if( !longName.empty() ) + return "--" + longName; + if( !shortNames.empty() ) + return "-" + shortNames[0]; + return "positional args"; + } + std::string commands() const { + std::ostringstream oss; + bool first = true; + std::vector::const_iterator it = shortNames.begin(), itEnd = shortNames.end(); + for(; it != itEnd; ++it ) { + if( first ) + first = false; + else + oss << ", "; + oss << "-" << *it; + } + if( !longName.empty() ) { + if( !first ) + oss << ", "; + oss << "--" << longName; + } + if( !placeholder.empty() ) + oss << " <" << placeholder << ">"; + return oss.str(); + } + }; + + typedef CLARA_AUTO_PTR( Arg ) ArgAutoPtr; + + friend void addOptName( Arg& arg, std::string const& optName ) + { + if( optName.empty() ) + return; + if( Detail::startsWith( optName, "--" ) ) { + if( !arg.longName.empty() ) + throw std::logic_error( "Only one long opt may be specified. '" + + arg.longName + + "' already specified, now attempting to add '" + + optName + "'" ); + arg.longName = optName.substr( 2 ); + } + else if( Detail::startsWith( optName, "-" ) ) + arg.shortNames.push_back( optName.substr( 1 ) ); + else + throw std::logic_error( "option must begin with - or --. Option was: '" + optName + "'" ); + } + friend void setPositionalArg( Arg& arg, int position ) + { + arg.position = position; + } + + class ArgBuilder { + public: + ArgBuilder( Arg* arg ) : m_arg( arg ) {} + + // Bind a non-boolean data member (requires placeholder string) + template + void bind( M C::* field, std::string const& placeholder ) { + m_arg->boundField = new Detail::BoundDataMember( field ); + m_arg->placeholder = placeholder; + } + // Bind a boolean data member (no placeholder required) + template + void bind( bool C::* field ) { + m_arg->boundField = new Detail::BoundDataMember( field ); + } + + // Bind a method taking a single, non-boolean argument (requires a placeholder string) + template + void bind( void (C::* unaryMethod)( M ), std::string const& placeholder ) { + m_arg->boundField = new Detail::BoundUnaryMethod( unaryMethod ); + m_arg->placeholder = placeholder; + } + + // Bind a method taking a single, boolean argument (no placeholder string required) + template + void bind( void (C::* unaryMethod)( bool ) ) { + m_arg->boundField = new Detail::BoundUnaryMethod( unaryMethod ); + } + + // Bind a method that takes no arguments (will be called if opt is present) + template + void bind( void (C::* nullaryMethod)() ) { + m_arg->boundField = new Detail::BoundNullaryMethod( nullaryMethod ); + } + + // Bind a free function taking a single argument - the object to operate on (no placeholder string required) + template + void bind( void (* unaryFunction)( C& ) ) { + m_arg->boundField = new Detail::BoundUnaryFunction( unaryFunction ); + } + + // Bind a free function taking a single argument - the object to operate on (requires a placeholder string) + template + void bind( void (* binaryFunction)( C&, T ), std::string const& placeholder ) { + m_arg->boundField = new Detail::BoundBinaryFunction( binaryFunction ); + m_arg->placeholder = placeholder; + } + + ArgBuilder& describe( std::string const& description ) { + m_arg->description = description; + return *this; + } + ArgBuilder& detail( std::string const& detail ) { + m_arg->detail = detail; + return *this; + } + + protected: + Arg* m_arg; + }; + + class OptBuilder : public ArgBuilder { + public: + OptBuilder( Arg* arg ) : ArgBuilder( arg ) {} + OptBuilder( OptBuilder& other ) : ArgBuilder( other ) {} + + OptBuilder& operator[]( std::string const& optName ) { + addOptName( *ArgBuilder::m_arg, optName ); + return *this; + } + }; + + public: + + CommandLine() + : m_boundProcessName( new Detail::NullBinder() ), + m_highestSpecifiedArgPosition( 0 ), + m_throwOnUnrecognisedTokens( false ) + {} + CommandLine( CommandLine const& other ) + : m_boundProcessName( other.m_boundProcessName ), + m_options ( other.m_options ), + m_positionalArgs( other.m_positionalArgs ), + m_highestSpecifiedArgPosition( other.m_highestSpecifiedArgPosition ), + m_throwOnUnrecognisedTokens( other.m_throwOnUnrecognisedTokens ) + { + if( other.m_floatingArg.get() ) + m_floatingArg.reset( new Arg( *other.m_floatingArg ) ); + } + + CommandLine& setThrowOnUnrecognisedTokens( bool shouldThrow = true ) { + m_throwOnUnrecognisedTokens = shouldThrow; + return *this; + } + + OptBuilder operator[]( std::string const& optName ) { + m_options.push_back( Arg() ); + addOptName( m_options.back(), optName ); + OptBuilder builder( &m_options.back() ); + return builder; + } + + ArgBuilder operator[]( int position ) { + m_positionalArgs.insert( std::make_pair( position, Arg() ) ); + if( position > m_highestSpecifiedArgPosition ) + m_highestSpecifiedArgPosition = position; + setPositionalArg( m_positionalArgs[position], position ); + ArgBuilder builder( &m_positionalArgs[position] ); + return builder; + } + + // Invoke this with the _ instance + ArgBuilder operator[]( UnpositionalTag ) { + if( m_floatingArg.get() ) + throw std::logic_error( "Only one unpositional argument can be added" ); + m_floatingArg.reset( new Arg() ); + ArgBuilder builder( m_floatingArg.get() ); + return builder; + } + + template + void bindProcessName( M C::* field ) { + m_boundProcessName = new Detail::BoundDataMember( field ); + } + template + void bindProcessName( void (C::*_unaryMethod)( M ) ) { + m_boundProcessName = new Detail::BoundUnaryMethod( _unaryMethod ); + } + + void optUsage( std::ostream& os, std::size_t indent = 0, std::size_t width = Detail::consoleWidth ) const { + typename std::vector::const_iterator itBegin = m_options.begin(), itEnd = m_options.end(), it; + std::size_t maxWidth = 0; + for( it = itBegin; it != itEnd; ++it ) + maxWidth = (std::max)( maxWidth, it->commands().size() ); + + for( it = itBegin; it != itEnd; ++it ) { + Detail::Text usage( it->commands(), Detail::TextAttributes() + .setWidth( maxWidth+indent ) + .setIndent( indent ) ); + Detail::Text desc( it->description, Detail::TextAttributes() + .setWidth( width - maxWidth - 3 ) ); + + for( std::size_t i = 0; i < (std::max)( usage.size(), desc.size() ); ++i ) { + std::string usageCol = i < usage.size() ? usage[i] : ""; + os << usageCol; + + if( i < desc.size() && !desc[i].empty() ) + os << std::string( indent + 2 + maxWidth - usageCol.size(), ' ' ) + << desc[i]; + os << "\n"; + } + } + } + std::string optUsage() const { + std::ostringstream oss; + optUsage( oss ); + return oss.str(); + } + + void argSynopsis( std::ostream& os ) const { + for( int i = 1; i <= m_highestSpecifiedArgPosition; ++i ) { + if( i > 1 ) + os << " "; + typename std::map::const_iterator it = m_positionalArgs.find( i ); + if( it != m_positionalArgs.end() ) + os << "<" << it->second.placeholder << ">"; + else if( m_floatingArg.get() ) + os << "<" << m_floatingArg->placeholder << ">"; + else + throw std::logic_error( "non consecutive positional arguments with no floating args" ); + } + // !TBD No indication of mandatory args + if( m_floatingArg.get() ) { + if( m_highestSpecifiedArgPosition > 1 ) + os << " "; + os << "[<" << m_floatingArg->placeholder << "> ...]"; + } + } + std::string argSynopsis() const { + std::ostringstream oss; + argSynopsis( oss ); + return oss.str(); + } + + void usage( std::ostream& os, std::string const& procName ) const { + validate(); + os << "usage:\n " << procName << " "; + argSynopsis( os ); + if( !m_options.empty() ) { + os << " [options]\n\nwhere options are: \n"; + optUsage( os, 2 ); + } + os << "\n"; + } + std::string usage( std::string const& procName ) const { + std::ostringstream oss; + usage( oss, procName ); + return oss.str(); + } + + ConfigT parse( std::vector const& args ) const { + ConfigT config; + parseInto( args, config ); + return config; + } + + std::vector parseInto( std::vector const& args, ConfigT& config ) const { + std::string processName = args.empty() ? std::string() : args[0]; + std::size_t lastSlash = processName.find_last_of( "/\\" ); + if( lastSlash != std::string::npos ) + processName = processName.substr( lastSlash+1 ); + m_boundProcessName.set( config, processName ); + std::vector tokens; + Parser parser; + parser.parseIntoTokens( args, tokens ); + return populate( tokens, config ); + } + + std::vector populate( std::vector const& tokens, ConfigT& config ) const { + validate(); + std::vector unusedTokens = populateOptions( tokens, config ); + unusedTokens = populateFixedArgs( unusedTokens, config ); + unusedTokens = populateFloatingArgs( unusedTokens, config ); + return unusedTokens; + } + + std::vector populateOptions( std::vector const& tokens, ConfigT& config ) const { + std::vector unusedTokens; + std::vector errors; + for( std::size_t i = 0; i < tokens.size(); ++i ) { + Parser::Token const& token = tokens[i]; + typename std::vector::const_iterator it = m_options.begin(), itEnd = m_options.end(); + for(; it != itEnd; ++it ) { + Arg const& arg = *it; + + try { + if( ( token.type == Parser::Token::ShortOpt && arg.hasShortName( token.data ) ) || + ( token.type == Parser::Token::LongOpt && arg.hasLongName( token.data ) ) ) { + if( arg.takesArg() ) { + if( i == tokens.size()-1 || tokens[i+1].type != Parser::Token::Positional ) + errors.push_back( "Expected argument to option: " + token.data ); + else + arg.boundField.set( config, tokens[++i].data ); + } + else { + arg.boundField.set( config, "true" ); + } + break; + } + } + catch( std::exception& ex ) { + errors.push_back( std::string( ex.what() ) + "\n- while parsing: (" + arg.commands() + ")" ); + } + } + if( it == itEnd ) { + if( token.type == Parser::Token::Positional || !m_throwOnUnrecognisedTokens ) + unusedTokens.push_back( token ); + else if( errors.empty() && m_throwOnUnrecognisedTokens ) + errors.push_back( "unrecognised option: " + token.data ); + } + } + if( !errors.empty() ) { + std::ostringstream oss; + for( std::vector::const_iterator it = errors.begin(), itEnd = errors.end(); + it != itEnd; + ++it ) { + if( it != errors.begin() ) + oss << "\n"; + oss << *it; + } + throw std::runtime_error( oss.str() ); + } + return unusedTokens; + } + std::vector populateFixedArgs( std::vector const& tokens, ConfigT& config ) const { + std::vector unusedTokens; + int position = 1; + for( std::size_t i = 0; i < tokens.size(); ++i ) { + Parser::Token const& token = tokens[i]; + typename std::map::const_iterator it = m_positionalArgs.find( position ); + if( it != m_positionalArgs.end() ) + it->second.boundField.set( config, token.data ); + else + unusedTokens.push_back( token ); + if( token.type == Parser::Token::Positional ) + position++; + } + return unusedTokens; + } + std::vector populateFloatingArgs( std::vector const& tokens, ConfigT& config ) const { + if( !m_floatingArg.get() ) + return tokens; + std::vector unusedTokens; + for( std::size_t i = 0; i < tokens.size(); ++i ) { + Parser::Token const& token = tokens[i]; + if( token.type == Parser::Token::Positional ) + m_floatingArg->boundField.set( config, token.data ); + else + unusedTokens.push_back( token ); + } + return unusedTokens; + } + + void validate() const + { + if( m_options.empty() && m_positionalArgs.empty() && !m_floatingArg.get() ) + throw std::logic_error( "No options or arguments specified" ); + + for( typename std::vector::const_iterator it = m_options.begin(), + itEnd = m_options.end(); + it != itEnd; ++it ) + it->validate(); + } + + private: + Detail::BoundArgFunction m_boundProcessName; + std::vector m_options; + std::map m_positionalArgs; + ArgAutoPtr m_floatingArg; + int m_highestSpecifiedArgPosition; + bool m_throwOnUnrecognisedTokens; + }; + +} // end namespace Clara + +STITCH_CLARA_CLOSE_NAMESPACE +#undef STITCH_CLARA_OPEN_NAMESPACE +#undef STITCH_CLARA_CLOSE_NAMESPACE + +#endif // TWOBLUECUBES_CLARA_H_INCLUDED +#undef STITCH_CLARA_OPEN_NAMESPACE + +// Restore Clara's value for console width, if present +#ifdef CATCH_TEMP_CLARA_CONFIG_CONSOLE_WIDTH +#define CLARA_CONFIG_CONSOLE_WIDTH CATCH_TEMP_CLARA_CONFIG_CONSOLE_WIDTH +#undef CATCH_TEMP_CLARA_CONFIG_CONSOLE_WIDTH +#endif + +#include +#include + +namespace Catch { + + inline void abortAfterFirst( ConfigData& config ) { config.abortAfter = 1; } + inline void abortAfterX( ConfigData& config, int x ) { + if( x < 1 ) + throw std::runtime_error( "Value after -x or --abortAfter must be greater than zero" ); + config.abortAfter = x; + } + inline void addTestOrTags( ConfigData& config, std::string const& _testSpec ) { config.testsOrTags.push_back( _testSpec ); } + inline void addSectionToRun( ConfigData& config, std::string const& sectionName ) { config.sectionsToRun.push_back( sectionName ); } + inline void addReporterName( ConfigData& config, std::string const& _reporterName ) { config.reporterNames.push_back( _reporterName ); } + + inline void addWarning( ConfigData& config, std::string const& _warning ) { + if( _warning == "NoAssertions" ) + config.warnings = static_cast( config.warnings | WarnAbout::NoAssertions ); + else + throw std::runtime_error( "Unrecognised warning: '" + _warning + '\'' ); + } + inline void setOrder( ConfigData& config, std::string const& order ) { + if( startsWith( "declared", order ) ) + config.runOrder = RunTests::InDeclarationOrder; + else if( startsWith( "lexical", order ) ) + config.runOrder = RunTests::InLexicographicalOrder; + else if( startsWith( "random", order ) ) + config.runOrder = RunTests::InRandomOrder; + else + throw std::runtime_error( "Unrecognised ordering: '" + order + '\'' ); + } + inline void setRngSeed( ConfigData& config, std::string const& seed ) { + if( seed == "time" ) { + config.rngSeed = static_cast( std::time(0) ); + } + else { + std::stringstream ss; + ss << seed; + ss >> config.rngSeed; + if( ss.fail() ) + throw std::runtime_error( "Argument to --rng-seed should be the word 'time' or a number" ); + } + } + inline void setVerbosity( ConfigData& config, int level ) { + // !TBD: accept strings? + config.verbosity = static_cast( level ); + } + inline void setShowDurations( ConfigData& config, bool _showDurations ) { + config.showDurations = _showDurations + ? ShowDurations::Always + : ShowDurations::Never; + } + inline void setUseColour( ConfigData& config, std::string const& value ) { + std::string mode = toLower( value ); + + if( mode == "yes" ) + config.useColour = UseColour::Yes; + else if( mode == "no" ) + config.useColour = UseColour::No; + else if( mode == "auto" ) + config.useColour = UseColour::Auto; + else + throw std::runtime_error( "colour mode must be one of: auto, yes or no" ); + } + inline void setWaitForKeypress( ConfigData& config, std::string const& keypress ) { + std::string keypressLc = toLower( keypress ); + if( keypressLc == "start" ) + config.waitForKeypress = WaitForKeypress::BeforeStart; + else if( keypressLc == "exit" ) + config.waitForKeypress = WaitForKeypress::BeforeExit; + else if( keypressLc == "both" ) + config.waitForKeypress = WaitForKeypress::BeforeStartAndExit; + else + throw std::runtime_error( "keypress argument must be one of: start, exit or both. '" + keypress + "' not recognised" ); + }; + + inline void forceColour( ConfigData& config ) { + config.useColour = UseColour::Yes; + } + inline void loadTestNamesFromFile( ConfigData& config, std::string const& _filename ) { + std::ifstream f( _filename.c_str() ); + if( !f.is_open() ) + throw std::domain_error( "Unable to load input file: " + _filename ); + + std::string line; + while( std::getline( f, line ) ) { + line = trim(line); + if( !line.empty() && !startsWith( line, '#' ) ) { + if( !startsWith( line, '"' ) ) + line = '"' + line + '"'; + addTestOrTags( config, line + ',' ); + } + } + } + + inline Clara::CommandLine makeCommandLineParser() { + + using namespace Clara; + CommandLine cli; + + cli.bindProcessName( &ConfigData::processName ); + + cli["-?"]["-h"]["--help"] + .describe( "display usage information" ) + .bind( &ConfigData::showHelp ); + + cli["-l"]["--list-tests"] + .describe( "list all/matching test cases" ) + .bind( &ConfigData::listTests ); + + cli["-t"]["--list-tags"] + .describe( "list all/matching tags" ) + .bind( &ConfigData::listTags ); + + cli["-s"]["--success"] + .describe( "include successful tests in output" ) + .bind( &ConfigData::showSuccessfulTests ); + + cli["-b"]["--break"] + .describe( "break into debugger on failure" ) + .bind( &ConfigData::shouldDebugBreak ); + + cli["-e"]["--nothrow"] + .describe( "skip exception tests" ) + .bind( &ConfigData::noThrow ); + + cli["-i"]["--invisibles"] + .describe( "show invisibles (tabs, newlines)" ) + .bind( &ConfigData::showInvisibles ); + + cli["-o"]["--out"] + .describe( "output filename" ) + .bind( &ConfigData::outputFilename, "filename" ); + + cli["-r"]["--reporter"] +// .placeholder( "name[:filename]" ) + .describe( "reporter to use (defaults to console)" ) + .bind( &addReporterName, "name" ); + + cli["-n"]["--name"] + .describe( "suite name" ) + .bind( &ConfigData::name, "name" ); + + cli["-a"]["--abort"] + .describe( "abort at first failure" ) + .bind( &abortAfterFirst ); + + cli["-x"]["--abortx"] + .describe( "abort after x failures" ) + .bind( &abortAfterX, "no. failures" ); + + cli["-w"]["--warn"] + .describe( "enable warnings" ) + .bind( &addWarning, "warning name" ); + +// - needs updating if reinstated +// cli.into( &setVerbosity ) +// .describe( "level of verbosity (0=no output)" ) +// .shortOpt( "v") +// .longOpt( "verbosity" ) +// .placeholder( "level" ); + + cli[_] + .describe( "which test or tests to use" ) + .bind( &addTestOrTags, "test name, pattern or tags" ); + + cli["-d"]["--durations"] + .describe( "show test durations" ) + .bind( &setShowDurations, "yes|no" ); + + cli["-f"]["--input-file"] + .describe( "load test names to run from a file" ) + .bind( &loadTestNamesFromFile, "filename" ); + + cli["-#"]["--filenames-as-tags"] + .describe( "adds a tag for the filename" ) + .bind( &ConfigData::filenamesAsTags ); + + cli["-c"]["--section"] + .describe( "specify section to run" ) + .bind( &addSectionToRun, "section name" ); + + // Less common commands which don't have a short form + cli["--list-test-names-only"] + .describe( "list all/matching test cases names only" ) + .bind( &ConfigData::listTestNamesOnly ); + + cli["--list-extra-info"] + .describe( "list all/matching test cases with more info" ) + .bind( &ConfigData::listExtraInfo ); + + cli["--list-reporters"] + .describe( "list all reporters" ) + .bind( &ConfigData::listReporters ); + + cli["--order"] + .describe( "test case order (defaults to decl)" ) + .bind( &setOrder, "decl|lex|rand" ); + + cli["--rng-seed"] + .describe( "set a specific seed for random numbers" ) + .bind( &setRngSeed, "'time'|number" ); + + cli["--force-colour"] + .describe( "force colourised output (deprecated)" ) + .bind( &forceColour ); + + cli["--use-colour"] + .describe( "should output be colourised" ) + .bind( &setUseColour, "yes|no" ); + + cli["--use-colour"] + .describe( "should output be colourised" ) + .bind( &setUseColour, "yes|no" ); + + cli["--libidentify"] + .describe( "report name and version according to libidentify standard" ) + .bind( &ConfigData::libIdentify ); + + cli["--wait-for-keypress"] + .describe( "waits for a keypress before exiting" ) + .bind( &setWaitForKeypress, "start|exit|both" ); + + return cli; + } + +} // end namespace Catch + +// #included from: internal/catch_list.hpp +#define TWOBLUECUBES_CATCH_LIST_HPP_INCLUDED + +// #included from: catch_text.h +#define TWOBLUECUBES_CATCH_TEXT_H_INCLUDED + +#define TBC_TEXT_FORMAT_CONSOLE_WIDTH CATCH_CONFIG_CONSOLE_WIDTH + +#define CLICHE_TBC_TEXT_FORMAT_OUTER_NAMESPACE Catch +// #included from: ../external/tbc_text_format.h +// Only use header guard if we are not using an outer namespace +#ifndef CLICHE_TBC_TEXT_FORMAT_OUTER_NAMESPACE +# ifdef TWOBLUECUBES_TEXT_FORMAT_H_INCLUDED +# ifndef TWOBLUECUBES_TEXT_FORMAT_H_ALREADY_INCLUDED +# define TWOBLUECUBES_TEXT_FORMAT_H_ALREADY_INCLUDED +# endif +# else +# define TWOBLUECUBES_TEXT_FORMAT_H_INCLUDED +# endif +#endif +#ifndef TWOBLUECUBES_TEXT_FORMAT_H_ALREADY_INCLUDED +#include +#include +#include + +// Use optional outer namespace +#ifdef CLICHE_TBC_TEXT_FORMAT_OUTER_NAMESPACE +namespace CLICHE_TBC_TEXT_FORMAT_OUTER_NAMESPACE { +#endif + +namespace Tbc { + +#ifdef TBC_TEXT_FORMAT_CONSOLE_WIDTH + const unsigned int consoleWidth = TBC_TEXT_FORMAT_CONSOLE_WIDTH; +#else + const unsigned int consoleWidth = 80; +#endif + + struct TextAttributes { + TextAttributes() + : initialIndent( std::string::npos ), + indent( 0 ), + width( consoleWidth-1 ) + {} + + TextAttributes& setInitialIndent( std::size_t _value ) { initialIndent = _value; return *this; } + TextAttributes& setIndent( std::size_t _value ) { indent = _value; return *this; } + TextAttributes& setWidth( std::size_t _value ) { width = _value; return *this; } + + std::size_t initialIndent; // indent of first line, or npos + std::size_t indent; // indent of subsequent lines, or all if initialIndent is npos + std::size_t width; // maximum width of text, including indent. Longer text will wrap + }; + + class Text { + public: + Text( std::string const& _str, TextAttributes const& _attr = TextAttributes() ) + : attr( _attr ) + { + const std::string wrappableBeforeChars = "[({<\t"; + const std::string wrappableAfterChars = "])}>-,./|\\"; + const std::string wrappableInsteadOfChars = " \n\r"; + std::string indent = _attr.initialIndent != std::string::npos + ? std::string( _attr.initialIndent, ' ' ) + : std::string( _attr.indent, ' ' ); + + typedef std::string::const_iterator iterator; + iterator it = _str.begin(); + const iterator strEnd = _str.end(); + + while( it != strEnd ) { + + if( lines.size() >= 1000 ) { + lines.push_back( "... message truncated due to excessive size" ); + return; + } + + std::string suffix; + std::size_t width = (std::min)( static_cast( strEnd-it ), _attr.width-static_cast( indent.size() ) ); + iterator itEnd = it+width; + iterator itNext = _str.end(); + + iterator itNewLine = std::find( it, itEnd, '\n' ); + if( itNewLine != itEnd ) + itEnd = itNewLine; + + if( itEnd != strEnd ) { + bool foundWrapPoint = false; + iterator findIt = itEnd; + do { + if( wrappableAfterChars.find( *findIt ) != std::string::npos && findIt != itEnd ) { + itEnd = findIt+1; + itNext = findIt+1; + foundWrapPoint = true; + } + else if( findIt > it && wrappableBeforeChars.find( *findIt ) != std::string::npos ) { + itEnd = findIt; + itNext = findIt; + foundWrapPoint = true; + } + else if( wrappableInsteadOfChars.find( *findIt ) != std::string::npos ) { + itNext = findIt+1; + itEnd = findIt; + foundWrapPoint = true; + } + if( findIt == it ) + break; + else + --findIt; + } + while( !foundWrapPoint ); + + if( !foundWrapPoint ) { + // No good wrap char, so we'll break mid word and add a hyphen + --itEnd; + itNext = itEnd; + suffix = "-"; + } + else { + while( itEnd > it && wrappableInsteadOfChars.find( *(itEnd-1) ) != std::string::npos ) + --itEnd; + } + } + lines.push_back( indent + std::string( it, itEnd ) + suffix ); + + if( indent.size() != _attr.indent ) + indent = std::string( _attr.indent, ' ' ); + it = itNext; + } + } + + typedef std::vector::const_iterator const_iterator; + + const_iterator begin() const { return lines.begin(); } + const_iterator end() const { return lines.end(); } + std::string const& last() const { return lines.back(); } + std::size_t size() const { return lines.size(); } + std::string const& operator[]( std::size_t _index ) const { return lines[_index]; } + std::string toString() const { + std::ostringstream oss; + oss << *this; + return oss.str(); + } + + inline friend std::ostream& operator << ( std::ostream& _stream, Text const& _text ) { + for( Text::const_iterator it = _text.begin(), itEnd = _text.end(); + it != itEnd; ++it ) { + if( it != _text.begin() ) + _stream << "\n"; + _stream << *it; + } + return _stream; + } + + private: + std::string str; + TextAttributes attr; + std::vector lines; + }; + +} // end namespace Tbc + +#ifdef CLICHE_TBC_TEXT_FORMAT_OUTER_NAMESPACE +} // end outer namespace +#endif + +#endif // TWOBLUECUBES_TEXT_FORMAT_H_ALREADY_INCLUDED +#undef CLICHE_TBC_TEXT_FORMAT_OUTER_NAMESPACE + +namespace Catch { + using Tbc::Text; + using Tbc::TextAttributes; +} + +// #included from: catch_console_colour.hpp +#define TWOBLUECUBES_CATCH_CONSOLE_COLOUR_HPP_INCLUDED + +namespace Catch { + + struct Colour { + enum Code { + None = 0, + + White, + Red, + Green, + Blue, + Cyan, + Yellow, + Grey, + + Bright = 0x10, + + BrightRed = Bright | Red, + BrightGreen = Bright | Green, + LightGrey = Bright | Grey, + BrightWhite = Bright | White, + + // By intention + FileName = LightGrey, + Warning = Yellow, + ResultError = BrightRed, + ResultSuccess = BrightGreen, + ResultExpectedFailure = Warning, + + Error = BrightRed, + Success = Green, + + OriginalExpression = Cyan, + ReconstructedExpression = Yellow, + + SecondaryText = LightGrey, + Headers = White + }; + + // Use constructed object for RAII guard + Colour( Code _colourCode ); + Colour( Colour const& other ); + ~Colour(); + + // Use static method for one-shot changes + static void use( Code _colourCode ); + + private: + bool m_moved; + }; + + inline std::ostream& operator << ( std::ostream& os, Colour const& ) { return os; } + +} // end namespace Catch + +// #included from: catch_interfaces_reporter.h +#define TWOBLUECUBES_CATCH_INTERFACES_REPORTER_H_INCLUDED + +#include +#include +#include + +namespace Catch +{ + struct ReporterConfig { + explicit ReporterConfig( Ptr const& _fullConfig ) + : m_stream( &_fullConfig->stream() ), m_fullConfig( _fullConfig ) {} + + ReporterConfig( Ptr const& _fullConfig, std::ostream& _stream ) + : m_stream( &_stream ), m_fullConfig( _fullConfig ) {} + + std::ostream& stream() const { return *m_stream; } + Ptr fullConfig() const { return m_fullConfig; } + + private: + std::ostream* m_stream; + Ptr m_fullConfig; + }; + + struct ReporterPreferences { + ReporterPreferences() + : shouldRedirectStdOut( false ) + {} + + bool shouldRedirectStdOut; + }; + + template + struct LazyStat : Option { + LazyStat() : used( false ) {} + LazyStat& operator=( T const& _value ) { + Option::operator=( _value ); + used = false; + return *this; + } + void reset() { + Option::reset(); + used = false; + } + bool used; + }; + + struct TestRunInfo { + TestRunInfo( std::string const& _name ) : name( _name ) {} + std::string name; + }; + struct GroupInfo { + GroupInfo( std::string const& _name, + std::size_t _groupIndex, + std::size_t _groupsCount ) + : name( _name ), + groupIndex( _groupIndex ), + groupsCounts( _groupsCount ) + {} + + std::string name; + std::size_t groupIndex; + std::size_t groupsCounts; + }; + + struct AssertionStats { + AssertionStats( AssertionResult const& _assertionResult, + std::vector const& _infoMessages, + Totals const& _totals ) + : assertionResult( _assertionResult ), + infoMessages( _infoMessages ), + totals( _totals ) + { + if( assertionResult.hasMessage() ) { + // Copy message into messages list. + // !TBD This should have been done earlier, somewhere + MessageBuilder builder( assertionResult.getTestMacroName(), assertionResult.getSourceInfo(), assertionResult.getResultType() ); + builder << assertionResult.getMessage(); + builder.m_info.message = builder.m_stream.str(); + + infoMessages.push_back( builder.m_info ); + } + } + virtual ~AssertionStats(); + +# ifdef CATCH_CONFIG_CPP11_GENERATED_METHODS + AssertionStats( AssertionStats const& ) = default; + AssertionStats( AssertionStats && ) = default; + AssertionStats& operator = ( AssertionStats const& ) = default; + AssertionStats& operator = ( AssertionStats && ) = default; +# endif + + AssertionResult assertionResult; + std::vector infoMessages; + Totals totals; + }; + + struct SectionStats { + SectionStats( SectionInfo const& _sectionInfo, + Counts const& _assertions, + double _durationInSeconds, + bool _missingAssertions ) + : sectionInfo( _sectionInfo ), + assertions( _assertions ), + durationInSeconds( _durationInSeconds ), + missingAssertions( _missingAssertions ) + {} + virtual ~SectionStats(); +# ifdef CATCH_CONFIG_CPP11_GENERATED_METHODS + SectionStats( SectionStats const& ) = default; + SectionStats( SectionStats && ) = default; + SectionStats& operator = ( SectionStats const& ) = default; + SectionStats& operator = ( SectionStats && ) = default; +# endif + + SectionInfo sectionInfo; + Counts assertions; + double durationInSeconds; + bool missingAssertions; + }; + + struct TestCaseStats { + TestCaseStats( TestCaseInfo const& _testInfo, + Totals const& _totals, + std::string const& _stdOut, + std::string const& _stdErr, + bool _aborting ) + : testInfo( _testInfo ), + totals( _totals ), + stdOut( _stdOut ), + stdErr( _stdErr ), + aborting( _aborting ) + {} + virtual ~TestCaseStats(); + +# ifdef CATCH_CONFIG_CPP11_GENERATED_METHODS + TestCaseStats( TestCaseStats const& ) = default; + TestCaseStats( TestCaseStats && ) = default; + TestCaseStats& operator = ( TestCaseStats const& ) = default; + TestCaseStats& operator = ( TestCaseStats && ) = default; +# endif + + TestCaseInfo testInfo; + Totals totals; + std::string stdOut; + std::string stdErr; + bool aborting; + }; + + struct TestGroupStats { + TestGroupStats( GroupInfo const& _groupInfo, + Totals const& _totals, + bool _aborting ) + : groupInfo( _groupInfo ), + totals( _totals ), + aborting( _aborting ) + {} + TestGroupStats( GroupInfo const& _groupInfo ) + : groupInfo( _groupInfo ), + aborting( false ) + {} + virtual ~TestGroupStats(); + +# ifdef CATCH_CONFIG_CPP11_GENERATED_METHODS + TestGroupStats( TestGroupStats const& ) = default; + TestGroupStats( TestGroupStats && ) = default; + TestGroupStats& operator = ( TestGroupStats const& ) = default; + TestGroupStats& operator = ( TestGroupStats && ) = default; +# endif + + GroupInfo groupInfo; + Totals totals; + bool aborting; + }; + + struct TestRunStats { + TestRunStats( TestRunInfo const& _runInfo, + Totals const& _totals, + bool _aborting ) + : runInfo( _runInfo ), + totals( _totals ), + aborting( _aborting ) + {} + virtual ~TestRunStats(); + +# ifndef CATCH_CONFIG_CPP11_GENERATED_METHODS + TestRunStats( TestRunStats const& _other ) + : runInfo( _other.runInfo ), + totals( _other.totals ), + aborting( _other.aborting ) + {} +# else + TestRunStats( TestRunStats const& ) = default; + TestRunStats( TestRunStats && ) = default; + TestRunStats& operator = ( TestRunStats const& ) = default; + TestRunStats& operator = ( TestRunStats && ) = default; +# endif + + TestRunInfo runInfo; + Totals totals; + bool aborting; + }; + + class MultipleReporters; + + struct IStreamingReporter : IShared { + virtual ~IStreamingReporter(); + + // Implementing class must also provide the following static method: + // static std::string getDescription(); + + virtual ReporterPreferences getPreferences() const = 0; + + virtual void noMatchingTestCases( std::string const& spec ) = 0; + + virtual void testRunStarting( TestRunInfo const& testRunInfo ) = 0; + virtual void testGroupStarting( GroupInfo const& groupInfo ) = 0; + + virtual void testCaseStarting( TestCaseInfo const& testInfo ) = 0; + virtual void sectionStarting( SectionInfo const& sectionInfo ) = 0; + + virtual void assertionStarting( AssertionInfo const& assertionInfo ) = 0; + + // The return value indicates if the messages buffer should be cleared: + virtual bool assertionEnded( AssertionStats const& assertionStats ) = 0; + + virtual void sectionEnded( SectionStats const& sectionStats ) = 0; + virtual void testCaseEnded( TestCaseStats const& testCaseStats ) = 0; + virtual void testGroupEnded( TestGroupStats const& testGroupStats ) = 0; + virtual void testRunEnded( TestRunStats const& testRunStats ) = 0; + + virtual void skipTest( TestCaseInfo const& testInfo ) = 0; + + virtual MultipleReporters* tryAsMulti() { return CATCH_NULL; } + }; + + struct IReporterFactory : IShared { + virtual ~IReporterFactory(); + virtual IStreamingReporter* create( ReporterConfig const& config ) const = 0; + virtual std::string getDescription() const = 0; + }; + + struct IReporterRegistry { + typedef std::map > FactoryMap; + typedef std::vector > Listeners; + + virtual ~IReporterRegistry(); + virtual IStreamingReporter* create( std::string const& name, Ptr const& config ) const = 0; + virtual FactoryMap const& getFactories() const = 0; + virtual Listeners const& getListeners() const = 0; + }; + + Ptr addReporter( Ptr const& existingReporter, Ptr const& additionalReporter ); + +} + +#include +#include + +namespace Catch { + + inline std::size_t listTests( Config const& config ) { + + TestSpec testSpec = config.testSpec(); + if( config.testSpec().hasFilters() ) + Catch::cout() << "Matching test cases:\n"; + else { + Catch::cout() << "All available test cases:\n"; + testSpec = TestSpecParser( ITagAliasRegistry::get() ).parse( "*" ).testSpec(); + } + + std::size_t matchedTests = 0; + TextAttributes nameAttr, descAttr, tagsAttr; + nameAttr.setInitialIndent( 2 ).setIndent( 4 ); + descAttr.setIndent( 4 ); + tagsAttr.setIndent( 6 ); + + std::vector matchedTestCases = filterTests( getAllTestCasesSorted( config ), testSpec, config ); + for( std::vector::const_iterator it = matchedTestCases.begin(), itEnd = matchedTestCases.end(); + it != itEnd; + ++it ) { + matchedTests++; + TestCaseInfo const& testCaseInfo = it->getTestCaseInfo(); + Colour::Code colour = testCaseInfo.isHidden() + ? Colour::SecondaryText + : Colour::None; + Colour colourGuard( colour ); + + Catch::cout() << Text( testCaseInfo.name, nameAttr ) << std::endl; + if( config.listExtraInfo() ) { + Catch::cout() << " " << testCaseInfo.lineInfo << std::endl; + std::string description = testCaseInfo.description; + if( description.empty() ) + description = "(NO DESCRIPTION)"; + Catch::cout() << Text( description, descAttr ) << std::endl; + } + if( !testCaseInfo.tags.empty() ) + Catch::cout() << Text( testCaseInfo.tagsAsString, tagsAttr ) << std::endl; + } + + if( !config.testSpec().hasFilters() ) + Catch::cout() << pluralise( matchedTests, "test case" ) << '\n' << std::endl; + else + Catch::cout() << pluralise( matchedTests, "matching test case" ) << '\n' << std::endl; + return matchedTests; + } + + inline std::size_t listTestsNamesOnly( Config const& config ) { + TestSpec testSpec = config.testSpec(); + if( !config.testSpec().hasFilters() ) + testSpec = TestSpecParser( ITagAliasRegistry::get() ).parse( "*" ).testSpec(); + std::size_t matchedTests = 0; + std::vector matchedTestCases = filterTests( getAllTestCasesSorted( config ), testSpec, config ); + for( std::vector::const_iterator it = matchedTestCases.begin(), itEnd = matchedTestCases.end(); + it != itEnd; + ++it ) { + matchedTests++; + TestCaseInfo const& testCaseInfo = it->getTestCaseInfo(); + if( startsWith( testCaseInfo.name, '#' ) ) + Catch::cout() << '"' << testCaseInfo.name << '"'; + else + Catch::cout() << testCaseInfo.name; + if ( config.listExtraInfo() ) + Catch::cout() << "\t@" << testCaseInfo.lineInfo; + Catch::cout() << std::endl; + } + return matchedTests; + } + + struct TagInfo { + TagInfo() : count ( 0 ) {} + void add( std::string const& spelling ) { + ++count; + spellings.insert( spelling ); + } + std::string all() const { + std::string out; + for( std::set::const_iterator it = spellings.begin(), itEnd = spellings.end(); + it != itEnd; + ++it ) + out += "[" + *it + "]"; + return out; + } + std::set spellings; + std::size_t count; + }; + + inline std::size_t listTags( Config const& config ) { + TestSpec testSpec = config.testSpec(); + if( config.testSpec().hasFilters() ) + Catch::cout() << "Tags for matching test cases:\n"; + else { + Catch::cout() << "All available tags:\n"; + testSpec = TestSpecParser( ITagAliasRegistry::get() ).parse( "*" ).testSpec(); + } + + std::map tagCounts; + + std::vector matchedTestCases = filterTests( getAllTestCasesSorted( config ), testSpec, config ); + for( std::vector::const_iterator it = matchedTestCases.begin(), itEnd = matchedTestCases.end(); + it != itEnd; + ++it ) { + for( std::set::const_iterator tagIt = it->getTestCaseInfo().tags.begin(), + tagItEnd = it->getTestCaseInfo().tags.end(); + tagIt != tagItEnd; + ++tagIt ) { + std::string tagName = *tagIt; + std::string lcaseTagName = toLower( tagName ); + std::map::iterator countIt = tagCounts.find( lcaseTagName ); + if( countIt == tagCounts.end() ) + countIt = tagCounts.insert( std::make_pair( lcaseTagName, TagInfo() ) ).first; + countIt->second.add( tagName ); + } + } + + for( std::map::const_iterator countIt = tagCounts.begin(), + countItEnd = tagCounts.end(); + countIt != countItEnd; + ++countIt ) { + std::ostringstream oss; + oss << " " << std::setw(2) << countIt->second.count << " "; + Text wrapper( countIt->second.all(), TextAttributes() + .setInitialIndent( 0 ) + .setIndent( oss.str().size() ) + .setWidth( CATCH_CONFIG_CONSOLE_WIDTH-10 ) ); + Catch::cout() << oss.str() << wrapper << '\n'; + } + Catch::cout() << pluralise( tagCounts.size(), "tag" ) << '\n' << std::endl; + return tagCounts.size(); + } + + inline std::size_t listReporters( Config const& /*config*/ ) { + Catch::cout() << "Available reporters:\n"; + IReporterRegistry::FactoryMap const& factories = getRegistryHub().getReporterRegistry().getFactories(); + IReporterRegistry::FactoryMap::const_iterator itBegin = factories.begin(), itEnd = factories.end(), it; + std::size_t maxNameLen = 0; + for(it = itBegin; it != itEnd; ++it ) + maxNameLen = (std::max)( maxNameLen, it->first.size() ); + + for(it = itBegin; it != itEnd; ++it ) { + Text wrapper( it->second->getDescription(), TextAttributes() + .setInitialIndent( 0 ) + .setIndent( 7+maxNameLen ) + .setWidth( CATCH_CONFIG_CONSOLE_WIDTH - maxNameLen-8 ) ); + Catch::cout() << " " + << it->first + << ':' + << std::string( maxNameLen - it->first.size() + 2, ' ' ) + << wrapper << '\n'; + } + Catch::cout() << std::endl; + return factories.size(); + } + + inline Option list( Config const& config ) { + Option listedCount; + if( config.listTests() || ( config.listExtraInfo() && !config.listTestNamesOnly() ) ) + listedCount = listedCount.valueOr(0) + listTests( config ); + if( config.listTestNamesOnly() ) + listedCount = listedCount.valueOr(0) + listTestsNamesOnly( config ); + if( config.listTags() ) + listedCount = listedCount.valueOr(0) + listTags( config ); + if( config.listReporters() ) + listedCount = listedCount.valueOr(0) + listReporters( config ); + return listedCount; + } + +} // end namespace Catch + +// #included from: internal/catch_run_context.hpp +#define TWOBLUECUBES_CATCH_RUNNER_IMPL_HPP_INCLUDED + +// #included from: catch_test_case_tracker.hpp +#define TWOBLUECUBES_CATCH_TEST_CASE_TRACKER_HPP_INCLUDED + +#include +#include +#include +#include +#include + +CATCH_INTERNAL_SUPPRESS_ETD_WARNINGS + +namespace Catch { +namespace TestCaseTracking { + + struct NameAndLocation { + std::string name; + SourceLineInfo location; + + NameAndLocation( std::string const& _name, SourceLineInfo const& _location ) + : name( _name ), + location( _location ) + {} + }; + + struct ITracker : SharedImpl<> { + virtual ~ITracker(); + + // static queries + virtual NameAndLocation const& nameAndLocation() const = 0; + + // dynamic queries + virtual bool isComplete() const = 0; // Successfully completed or failed + virtual bool isSuccessfullyCompleted() const = 0; + virtual bool isOpen() const = 0; // Started but not complete + virtual bool hasChildren() const = 0; + + virtual ITracker& parent() = 0; + + // actions + virtual void close() = 0; // Successfully complete + virtual void fail() = 0; + virtual void markAsNeedingAnotherRun() = 0; + + virtual void addChild( Ptr const& child ) = 0; + virtual ITracker* findChild( NameAndLocation const& nameAndLocation ) = 0; + virtual void openChild() = 0; + + // Debug/ checking + virtual bool isSectionTracker() const = 0; + virtual bool isIndexTracker() const = 0; + }; + + class TrackerContext { + + enum RunState { + NotStarted, + Executing, + CompletedCycle + }; + + Ptr m_rootTracker; + ITracker* m_currentTracker; + RunState m_runState; + + public: + + static TrackerContext& instance() { + static TrackerContext s_instance; + return s_instance; + } + + TrackerContext() + : m_currentTracker( CATCH_NULL ), + m_runState( NotStarted ) + {} + + ITracker& startRun(); + + void endRun() { + m_rootTracker.reset(); + m_currentTracker = CATCH_NULL; + m_runState = NotStarted; + } + + void startCycle() { + m_currentTracker = m_rootTracker.get(); + m_runState = Executing; + } + void completeCycle() { + m_runState = CompletedCycle; + } + + bool completedCycle() const { + return m_runState == CompletedCycle; + } + ITracker& currentTracker() { + return *m_currentTracker; + } + void setCurrentTracker( ITracker* tracker ) { + m_currentTracker = tracker; + } + }; + + class TrackerBase : public ITracker { + protected: + enum CycleState { + NotStarted, + Executing, + ExecutingChildren, + NeedsAnotherRun, + CompletedSuccessfully, + Failed + }; + class TrackerHasName { + NameAndLocation m_nameAndLocation; + public: + TrackerHasName( NameAndLocation const& nameAndLocation ) : m_nameAndLocation( nameAndLocation ) {} + bool operator ()( Ptr const& tracker ) { + return + tracker->nameAndLocation().name == m_nameAndLocation.name && + tracker->nameAndLocation().location == m_nameAndLocation.location; + } + }; + typedef std::vector > Children; + NameAndLocation m_nameAndLocation; + TrackerContext& m_ctx; + ITracker* m_parent; + Children m_children; + CycleState m_runState; + public: + TrackerBase( NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent ) + : m_nameAndLocation( nameAndLocation ), + m_ctx( ctx ), + m_parent( parent ), + m_runState( NotStarted ) + {} + virtual ~TrackerBase(); + + virtual NameAndLocation const& nameAndLocation() const CATCH_OVERRIDE { + return m_nameAndLocation; + } + virtual bool isComplete() const CATCH_OVERRIDE { + return m_runState == CompletedSuccessfully || m_runState == Failed; + } + virtual bool isSuccessfullyCompleted() const CATCH_OVERRIDE { + return m_runState == CompletedSuccessfully; + } + virtual bool isOpen() const CATCH_OVERRIDE { + return m_runState != NotStarted && !isComplete(); + } + virtual bool hasChildren() const CATCH_OVERRIDE { + return !m_children.empty(); + } + + virtual void addChild( Ptr const& child ) CATCH_OVERRIDE { + m_children.push_back( child ); + } + + virtual ITracker* findChild( NameAndLocation const& nameAndLocation ) CATCH_OVERRIDE { + Children::const_iterator it = std::find_if( m_children.begin(), m_children.end(), TrackerHasName( nameAndLocation ) ); + return( it != m_children.end() ) + ? it->get() + : CATCH_NULL; + } + virtual ITracker& parent() CATCH_OVERRIDE { + assert( m_parent ); // Should always be non-null except for root + return *m_parent; + } + + virtual void openChild() CATCH_OVERRIDE { + if( m_runState != ExecutingChildren ) { + m_runState = ExecutingChildren; + if( m_parent ) + m_parent->openChild(); + } + } + + virtual bool isSectionTracker() const CATCH_OVERRIDE { return false; } + virtual bool isIndexTracker() const CATCH_OVERRIDE { return false; } + + void open() { + m_runState = Executing; + moveToThis(); + if( m_parent ) + m_parent->openChild(); + } + + virtual void close() CATCH_OVERRIDE { + + // Close any still open children (e.g. generators) + while( &m_ctx.currentTracker() != this ) + m_ctx.currentTracker().close(); + + switch( m_runState ) { + case NotStarted: + case CompletedSuccessfully: + case Failed: + throw std::logic_error( "Illogical state" ); + + case NeedsAnotherRun: + break;; + + case Executing: + m_runState = CompletedSuccessfully; + break; + case ExecutingChildren: + if( m_children.empty() || m_children.back()->isComplete() ) + m_runState = CompletedSuccessfully; + break; + + default: + throw std::logic_error( "Unexpected state" ); + } + moveToParent(); + m_ctx.completeCycle(); + } + virtual void fail() CATCH_OVERRIDE { + m_runState = Failed; + if( m_parent ) + m_parent->markAsNeedingAnotherRun(); + moveToParent(); + m_ctx.completeCycle(); + } + virtual void markAsNeedingAnotherRun() CATCH_OVERRIDE { + m_runState = NeedsAnotherRun; + } + private: + void moveToParent() { + assert( m_parent ); + m_ctx.setCurrentTracker( m_parent ); + } + void moveToThis() { + m_ctx.setCurrentTracker( this ); + } + }; + + class SectionTracker : public TrackerBase { + std::vector m_filters; + public: + SectionTracker( NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent ) + : TrackerBase( nameAndLocation, ctx, parent ) + { + if( parent ) { + while( !parent->isSectionTracker() ) + parent = &parent->parent(); + + SectionTracker& parentSection = static_cast( *parent ); + addNextFilters( parentSection.m_filters ); + } + } + virtual ~SectionTracker(); + + virtual bool isSectionTracker() const CATCH_OVERRIDE { return true; } + + static SectionTracker& acquire( TrackerContext& ctx, NameAndLocation const& nameAndLocation ) { + SectionTracker* section = CATCH_NULL; + + ITracker& currentTracker = ctx.currentTracker(); + if( ITracker* childTracker = currentTracker.findChild( nameAndLocation ) ) { + assert( childTracker ); + assert( childTracker->isSectionTracker() ); + section = static_cast( childTracker ); + } + else { + section = new SectionTracker( nameAndLocation, ctx, ¤tTracker ); + currentTracker.addChild( section ); + } + if( !ctx.completedCycle() ) + section->tryOpen(); + return *section; + } + + void tryOpen() { + if( !isComplete() && (m_filters.empty() || m_filters[0].empty() || m_filters[0] == m_nameAndLocation.name ) ) + open(); + } + + void addInitialFilters( std::vector const& filters ) { + if( !filters.empty() ) { + m_filters.push_back(""); // Root - should never be consulted + m_filters.push_back(""); // Test Case - not a section filter + m_filters.insert( m_filters.end(), filters.begin(), filters.end() ); + } + } + void addNextFilters( std::vector const& filters ) { + if( filters.size() > 1 ) + m_filters.insert( m_filters.end(), ++filters.begin(), filters.end() ); + } + }; + + class IndexTracker : public TrackerBase { + int m_size; + int m_index; + public: + IndexTracker( NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent, int size ) + : TrackerBase( nameAndLocation, ctx, parent ), + m_size( size ), + m_index( -1 ) + {} + virtual ~IndexTracker(); + + virtual bool isIndexTracker() const CATCH_OVERRIDE { return true; } + + static IndexTracker& acquire( TrackerContext& ctx, NameAndLocation const& nameAndLocation, int size ) { + IndexTracker* tracker = CATCH_NULL; + + ITracker& currentTracker = ctx.currentTracker(); + if( ITracker* childTracker = currentTracker.findChild( nameAndLocation ) ) { + assert( childTracker ); + assert( childTracker->isIndexTracker() ); + tracker = static_cast( childTracker ); + } + else { + tracker = new IndexTracker( nameAndLocation, ctx, ¤tTracker, size ); + currentTracker.addChild( tracker ); + } + + if( !ctx.completedCycle() && !tracker->isComplete() ) { + if( tracker->m_runState != ExecutingChildren && tracker->m_runState != NeedsAnotherRun ) + tracker->moveNext(); + tracker->open(); + } + + return *tracker; + } + + int index() const { return m_index; } + + void moveNext() { + m_index++; + m_children.clear(); + } + + virtual void close() CATCH_OVERRIDE { + TrackerBase::close(); + if( m_runState == CompletedSuccessfully && m_index < m_size-1 ) + m_runState = Executing; + } + }; + + inline ITracker& TrackerContext::startRun() { + m_rootTracker = new SectionTracker( NameAndLocation( "{root}", CATCH_INTERNAL_LINEINFO ), *this, CATCH_NULL ); + m_currentTracker = CATCH_NULL; + m_runState = Executing; + return *m_rootTracker; + } + +} // namespace TestCaseTracking + +using TestCaseTracking::ITracker; +using TestCaseTracking::TrackerContext; +using TestCaseTracking::SectionTracker; +using TestCaseTracking::IndexTracker; + +} // namespace Catch + +CATCH_INTERNAL_UNSUPPRESS_ETD_WARNINGS + +// #included from: catch_fatal_condition.hpp +#define TWOBLUECUBES_CATCH_FATAL_CONDITION_H_INCLUDED + +namespace Catch { + + // Report the error condition + inline void reportFatal( std::string const& message ) { + IContext& context = Catch::getCurrentContext(); + IResultCapture* resultCapture = context.getResultCapture(); + resultCapture->handleFatalErrorCondition( message ); + } + +} // namespace Catch + +#if defined ( CATCH_PLATFORM_WINDOWS ) ///////////////////////////////////////// +// #included from: catch_windows_h_proxy.h + +#define TWOBLUECUBES_CATCH_WINDOWS_H_PROXY_H_INCLUDED + +#ifdef CATCH_DEFINES_NOMINMAX +# define NOMINMAX +#endif +#ifdef CATCH_DEFINES_WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +#endif + +#ifdef __AFXDLL +#include +#else +#include +#endif + +#ifdef CATCH_DEFINES_NOMINMAX +# undef NOMINMAX +#endif +#ifdef CATCH_DEFINES_WIN32_LEAN_AND_MEAN +# undef WIN32_LEAN_AND_MEAN +#endif + + +# if !defined ( CATCH_CONFIG_WINDOWS_SEH ) + +namespace Catch { + struct FatalConditionHandler { + void reset() {} + }; +} + +# else // CATCH_CONFIG_WINDOWS_SEH is defined + +namespace Catch { + + struct SignalDefs { DWORD id; const char* name; }; + extern SignalDefs signalDefs[]; + // There is no 1-1 mapping between signals and windows exceptions. + // Windows can easily distinguish between SO and SigSegV, + // but SigInt, SigTerm, etc are handled differently. + SignalDefs signalDefs[] = { + { EXCEPTION_ILLEGAL_INSTRUCTION, "SIGILL - Illegal instruction signal" }, + { EXCEPTION_STACK_OVERFLOW, "SIGSEGV - Stack overflow" }, + { EXCEPTION_ACCESS_VIOLATION, "SIGSEGV - Segmentation violation signal" }, + { EXCEPTION_INT_DIVIDE_BY_ZERO, "Divide by zero error" }, + }; + + struct FatalConditionHandler { + + static LONG CALLBACK handleVectoredException(PEXCEPTION_POINTERS ExceptionInfo) { + for (int i = 0; i < sizeof(signalDefs) / sizeof(SignalDefs); ++i) { + if (ExceptionInfo->ExceptionRecord->ExceptionCode == signalDefs[i].id) { + reportFatal(signalDefs[i].name); + } + } + // If its not an exception we care about, pass it along. + // This stops us from eating debugger breaks etc. + return EXCEPTION_CONTINUE_SEARCH; + } + + FatalConditionHandler() { + isSet = true; + // 32k seems enough for Catch to handle stack overflow, + // but the value was found experimentally, so there is no strong guarantee + guaranteeSize = 32 * 1024; + exceptionHandlerHandle = CATCH_NULL; + // Register as first handler in current chain + exceptionHandlerHandle = AddVectoredExceptionHandler(1, handleVectoredException); + // Pass in guarantee size to be filled + SetThreadStackGuarantee(&guaranteeSize); + } + + static void reset() { + if (isSet) { + // Unregister handler and restore the old guarantee + RemoveVectoredExceptionHandler(exceptionHandlerHandle); + SetThreadStackGuarantee(&guaranteeSize); + exceptionHandlerHandle = CATCH_NULL; + isSet = false; + } + } + + ~FatalConditionHandler() { + reset(); + } + private: + static bool isSet; + static ULONG guaranteeSize; + static PVOID exceptionHandlerHandle; + }; + + bool FatalConditionHandler::isSet = false; + ULONG FatalConditionHandler::guaranteeSize = 0; + PVOID FatalConditionHandler::exceptionHandlerHandle = CATCH_NULL; + +} // namespace Catch + +# endif // CATCH_CONFIG_WINDOWS_SEH + +#else // Not Windows - assumed to be POSIX compatible ////////////////////////// + +# if !defined(CATCH_CONFIG_POSIX_SIGNALS) + +namespace Catch { + struct FatalConditionHandler { + void reset() {} + }; +} + +# else // CATCH_CONFIG_POSIX_SIGNALS is defined + +#include + +namespace Catch { + + struct SignalDefs { + int id; + const char* name; + }; + extern SignalDefs signalDefs[]; + SignalDefs signalDefs[] = { + { SIGINT, "SIGINT - Terminal interrupt signal" }, + { SIGILL, "SIGILL - Illegal instruction signal" }, + { SIGFPE, "SIGFPE - Floating point error signal" }, + { SIGSEGV, "SIGSEGV - Segmentation violation signal" }, + { SIGTERM, "SIGTERM - Termination request signal" }, + { SIGABRT, "SIGABRT - Abort (abnormal termination) signal" } + }; + + struct FatalConditionHandler { + + static bool isSet; + static struct sigaction oldSigActions [sizeof(signalDefs)/sizeof(SignalDefs)]; + static stack_t oldSigStack; + static char altStackMem[SIGSTKSZ]; + + static void handleSignal( int sig ) { + std::string name = ""; + for (std::size_t i = 0; i < sizeof(signalDefs) / sizeof(SignalDefs); ++i) { + SignalDefs &def = signalDefs[i]; + if (sig == def.id) { + name = def.name; + break; + } + } + reset(); + reportFatal(name); + raise( sig ); + } + + FatalConditionHandler() { + isSet = true; + stack_t sigStack; + sigStack.ss_sp = altStackMem; + sigStack.ss_size = SIGSTKSZ; + sigStack.ss_flags = 0; + sigaltstack(&sigStack, &oldSigStack); + struct sigaction sa = { 0 }; + + sa.sa_handler = handleSignal; + sa.sa_flags = SA_ONSTACK; + for (std::size_t i = 0; i < sizeof(signalDefs)/sizeof(SignalDefs); ++i) { + sigaction(signalDefs[i].id, &sa, &oldSigActions[i]); + } + } + + ~FatalConditionHandler() { + reset(); + } + static void reset() { + if( isSet ) { + // Set signals back to previous values -- hopefully nobody overwrote them in the meantime + for( std::size_t i = 0; i < sizeof(signalDefs)/sizeof(SignalDefs); ++i ) { + sigaction(signalDefs[i].id, &oldSigActions[i], CATCH_NULL); + } + // Return the old stack + sigaltstack(&oldSigStack, CATCH_NULL); + isSet = false; + } + } + }; + + bool FatalConditionHandler::isSet = false; + struct sigaction FatalConditionHandler::oldSigActions[sizeof(signalDefs)/sizeof(SignalDefs)] = {}; + stack_t FatalConditionHandler::oldSigStack = {}; + char FatalConditionHandler::altStackMem[SIGSTKSZ] = {}; + +} // namespace Catch + +# endif // CATCH_CONFIG_POSIX_SIGNALS + +#endif // not Windows + +#include +#include + +namespace Catch { + + class StreamRedirect { + + public: + StreamRedirect( std::ostream& stream, std::string& targetString ) + : m_stream( stream ), + m_prevBuf( stream.rdbuf() ), + m_targetString( targetString ) + { + stream.rdbuf( m_oss.rdbuf() ); + } + + ~StreamRedirect() { + m_targetString += m_oss.str(); + m_stream.rdbuf( m_prevBuf ); + } + + private: + std::ostream& m_stream; + std::streambuf* m_prevBuf; + std::ostringstream m_oss; + std::string& m_targetString; + }; + + // StdErr has two constituent streams in C++, std::cerr and std::clog + // This means that we need to redirect 2 streams into 1 to keep proper + // order of writes and cannot use StreamRedirect on its own + class StdErrRedirect { + public: + StdErrRedirect(std::string& targetString) + :m_cerrBuf( cerr().rdbuf() ), m_clogBuf(clog().rdbuf()), + m_targetString(targetString){ + cerr().rdbuf(m_oss.rdbuf()); + clog().rdbuf(m_oss.rdbuf()); + } + ~StdErrRedirect() { + m_targetString += m_oss.str(); + cerr().rdbuf(m_cerrBuf); + clog().rdbuf(m_clogBuf); + } + private: + std::streambuf* m_cerrBuf; + std::streambuf* m_clogBuf; + std::ostringstream m_oss; + std::string& m_targetString; + }; + + /////////////////////////////////////////////////////////////////////////// + + class RunContext : public IResultCapture, public IRunner { + + RunContext( RunContext const& ); + void operator =( RunContext const& ); + + public: + + explicit RunContext( Ptr const& _config, Ptr const& reporter ) + : m_runInfo( _config->name() ), + m_context( getCurrentMutableContext() ), + m_activeTestCase( CATCH_NULL ), + m_config( _config ), + m_reporter( reporter ), + m_shouldReportUnexpected ( true ) + { + m_context.setRunner( this ); + m_context.setConfig( m_config ); + m_context.setResultCapture( this ); + m_reporter->testRunStarting( m_runInfo ); + } + + virtual ~RunContext() { + m_reporter->testRunEnded( TestRunStats( m_runInfo, m_totals, aborting() ) ); + } + + void testGroupStarting( std::string const& testSpec, std::size_t groupIndex, std::size_t groupsCount ) { + m_reporter->testGroupStarting( GroupInfo( testSpec, groupIndex, groupsCount ) ); + } + void testGroupEnded( std::string const& testSpec, Totals const& totals, std::size_t groupIndex, std::size_t groupsCount ) { + m_reporter->testGroupEnded( TestGroupStats( GroupInfo( testSpec, groupIndex, groupsCount ), totals, aborting() ) ); + } + + Totals runTest( TestCase const& testCase ) { + Totals prevTotals = m_totals; + + std::string redirectedCout; + std::string redirectedCerr; + + TestCaseInfo testInfo = testCase.getTestCaseInfo(); + + m_reporter->testCaseStarting( testInfo ); + + m_activeTestCase = &testCase; + + do { + ITracker& rootTracker = m_trackerContext.startRun(); + assert( rootTracker.isSectionTracker() ); + static_cast( rootTracker ).addInitialFilters( m_config->getSectionsToRun() ); + do { + m_trackerContext.startCycle(); + m_testCaseTracker = &SectionTracker::acquire( m_trackerContext, TestCaseTracking::NameAndLocation( testInfo.name, testInfo.lineInfo ) ); + runCurrentTest( redirectedCout, redirectedCerr ); + } + while( !m_testCaseTracker->isSuccessfullyCompleted() && !aborting() ); + } + // !TBD: deprecated - this will be replaced by indexed trackers + while( getCurrentContext().advanceGeneratorsForCurrentTest() && !aborting() ); + + Totals deltaTotals = m_totals.delta( prevTotals ); + if( testInfo.expectedToFail() && deltaTotals.testCases.passed > 0 ) { + deltaTotals.assertions.failed++; + deltaTotals.testCases.passed--; + deltaTotals.testCases.failed++; + } + m_totals.testCases += deltaTotals.testCases; + m_reporter->testCaseEnded( TestCaseStats( testInfo, + deltaTotals, + redirectedCout, + redirectedCerr, + aborting() ) ); + + m_activeTestCase = CATCH_NULL; + m_testCaseTracker = CATCH_NULL; + + return deltaTotals; + } + + Ptr config() const { + return m_config; + } + + private: // IResultCapture + + virtual void assertionEnded( AssertionResult const& result ) { + if( result.getResultType() == ResultWas::Ok ) { + m_totals.assertions.passed++; + } + else if( !result.isOk() ) { + if( m_activeTestCase->getTestCaseInfo().okToFail() ) + m_totals.assertions.failedButOk++; + else + m_totals.assertions.failed++; + } + + // We have no use for the return value (whether messages should be cleared), because messages were made scoped + // and should be let to clear themselves out. + static_cast(m_reporter->assertionEnded(AssertionStats(result, m_messages, m_totals))); + + // Reset working state + m_lastAssertionInfo = AssertionInfo( "", m_lastAssertionInfo.lineInfo, "{Unknown expression after the reported line}" , m_lastAssertionInfo.resultDisposition ); + m_lastResult = result; + } + + virtual bool lastAssertionPassed() + { + return m_totals.assertions.passed == (m_prevPassed + 1); + } + + virtual void assertionPassed() + { + m_totals.assertions.passed++; + m_lastAssertionInfo.capturedExpression = "{Unknown expression after the reported line}"; + m_lastAssertionInfo.macroName = ""; + } + + virtual void assertionRun() + { + m_prevPassed = m_totals.assertions.passed; + } + + virtual bool sectionStarted ( + SectionInfo const& sectionInfo, + Counts& assertions + ) + { + ITracker& sectionTracker = SectionTracker::acquire( m_trackerContext, TestCaseTracking::NameAndLocation( sectionInfo.name, sectionInfo.lineInfo ) ); + if( !sectionTracker.isOpen() ) + return false; + m_activeSections.push_back( §ionTracker ); + + m_lastAssertionInfo.lineInfo = sectionInfo.lineInfo; + + m_reporter->sectionStarting( sectionInfo ); + + assertions = m_totals.assertions; + + return true; + } + bool testForMissingAssertions( Counts& assertions ) { + if( assertions.total() != 0 ) + return false; + if( !m_config->warnAboutMissingAssertions() ) + return false; + if( m_trackerContext.currentTracker().hasChildren() ) + return false; + m_totals.assertions.failed++; + assertions.failed++; + return true; + } + + virtual void sectionEnded( SectionEndInfo const& endInfo ) { + Counts assertions = m_totals.assertions - endInfo.prevAssertions; + bool missingAssertions = testForMissingAssertions( assertions ); + + if( !m_activeSections.empty() ) { + m_activeSections.back()->close(); + m_activeSections.pop_back(); + } + + m_reporter->sectionEnded( SectionStats( endInfo.sectionInfo, assertions, endInfo.durationInSeconds, missingAssertions ) ); + m_messages.clear(); + } + + virtual void sectionEndedEarly( SectionEndInfo const& endInfo ) { + if( m_unfinishedSections.empty() ) + m_activeSections.back()->fail(); + else + m_activeSections.back()->close(); + m_activeSections.pop_back(); + + m_unfinishedSections.push_back( endInfo ); + } + + virtual void pushScopedMessage( MessageInfo const& message ) { + m_messages.push_back( message ); + } + + virtual void popScopedMessage( MessageInfo const& message ) { + m_messages.erase( std::remove( m_messages.begin(), m_messages.end(), message ), m_messages.end() ); + } + + virtual std::string getCurrentTestName() const { + return m_activeTestCase + ? m_activeTestCase->getTestCaseInfo().name + : std::string(); + } + + virtual const AssertionResult* getLastResult() const { + return &m_lastResult; + } + + virtual void exceptionEarlyReported() { + m_shouldReportUnexpected = false; + } + + virtual void handleFatalErrorCondition( std::string const& message ) { + // Don't rebuild the result -- the stringification itself can cause more fatal errors + // Instead, fake a result data. + AssertionResultData tempResult; + tempResult.resultType = ResultWas::FatalErrorCondition; + tempResult.message = message; + AssertionResult result(m_lastAssertionInfo, tempResult); + + getResultCapture().assertionEnded(result); + + handleUnfinishedSections(); + + // Recreate section for test case (as we will lose the one that was in scope) + TestCaseInfo const& testCaseInfo = m_activeTestCase->getTestCaseInfo(); + SectionInfo testCaseSection( testCaseInfo.lineInfo, testCaseInfo.name, testCaseInfo.description ); + + Counts assertions; + assertions.failed = 1; + SectionStats testCaseSectionStats( testCaseSection, assertions, 0, false ); + m_reporter->sectionEnded( testCaseSectionStats ); + + TestCaseInfo testInfo = m_activeTestCase->getTestCaseInfo(); + + Totals deltaTotals; + deltaTotals.testCases.failed = 1; + deltaTotals.assertions.failed = 1; + m_reporter->testCaseEnded( TestCaseStats( testInfo, + deltaTotals, + std::string(), + std::string(), + false ) ); + m_totals.testCases.failed++; + testGroupEnded( std::string(), m_totals, 1, 1 ); + m_reporter->testRunEnded( TestRunStats( m_runInfo, m_totals, false ) ); + } + + public: + // !TBD We need to do this another way! + bool aborting() const { + return m_totals.assertions.failed == static_cast( m_config->abortAfter() ); + } + + private: + + void runCurrentTest( std::string& redirectedCout, std::string& redirectedCerr ) { + TestCaseInfo const& testCaseInfo = m_activeTestCase->getTestCaseInfo(); + SectionInfo testCaseSection( testCaseInfo.lineInfo, testCaseInfo.name, testCaseInfo.description ); + m_reporter->sectionStarting( testCaseSection ); + Counts prevAssertions = m_totals.assertions; + double duration = 0; + m_shouldReportUnexpected = true; + try { + m_lastAssertionInfo = AssertionInfo( "TEST_CASE", testCaseInfo.lineInfo, "", ResultDisposition::Normal ); + + seedRng( *m_config ); + + Timer timer; + timer.start(); + if( m_reporter->getPreferences().shouldRedirectStdOut ) { + StreamRedirect coutRedir( Catch::cout(), redirectedCout ); + StdErrRedirect errRedir( redirectedCerr ); + invokeActiveTestCase(); + } + else { + invokeActiveTestCase(); + } + duration = timer.getElapsedSeconds(); + } + catch( TestFailureException& ) { + // This just means the test was aborted due to failure + } + catch(...) { + // Under CATCH_CONFIG_FAST_COMPILE, unexpected exceptions under REQUIRE assertions + // are reported without translation at the point of origin. + if (m_shouldReportUnexpected) { + makeUnexpectedResultBuilder().useActiveException(); + } + } + m_testCaseTracker->close(); + handleUnfinishedSections(); + m_messages.clear(); + + Counts assertions = m_totals.assertions - prevAssertions; + bool missingAssertions = testForMissingAssertions( assertions ); + + SectionStats testCaseSectionStats( testCaseSection, assertions, duration, missingAssertions ); + m_reporter->sectionEnded( testCaseSectionStats ); + } + + void invokeActiveTestCase() { + FatalConditionHandler fatalConditionHandler; // Handle signals + m_activeTestCase->invoke(); + fatalConditionHandler.reset(); + } + + private: + + ResultBuilder makeUnexpectedResultBuilder() const { + return ResultBuilder( m_lastAssertionInfo.macroName, + m_lastAssertionInfo.lineInfo, + m_lastAssertionInfo.capturedExpression, + m_lastAssertionInfo.resultDisposition ); + } + + void handleUnfinishedSections() { + // If sections ended prematurely due to an exception we stored their + // infos here so we can tear them down outside the unwind process. + for( std::vector::const_reverse_iterator it = m_unfinishedSections.rbegin(), + itEnd = m_unfinishedSections.rend(); + it != itEnd; + ++it ) + sectionEnded( *it ); + m_unfinishedSections.clear(); + } + + TestRunInfo m_runInfo; + IMutableContext& m_context; + TestCase const* m_activeTestCase; + ITracker* m_testCaseTracker; + ITracker* m_currentSectionTracker; + AssertionResult m_lastResult; + + Ptr m_config; + Totals m_totals; + Ptr m_reporter; + std::vector m_messages; + AssertionInfo m_lastAssertionInfo; + std::vector m_unfinishedSections; + std::vector m_activeSections; + TrackerContext m_trackerContext; + size_t m_prevPassed; + bool m_shouldReportUnexpected; + }; + + IResultCapture& getResultCapture() { + if( IResultCapture* capture = getCurrentContext().getResultCapture() ) + return *capture; + else + throw std::logic_error( "No result capture instance" ); + } + +} // end namespace Catch + +// #included from: internal/catch_version.h +#define TWOBLUECUBES_CATCH_VERSION_H_INCLUDED + +namespace Catch { + + // Versioning information + struct Version { + Version( unsigned int _majorVersion, + unsigned int _minorVersion, + unsigned int _patchNumber, + char const * const _branchName, + unsigned int _buildNumber ); + + unsigned int const majorVersion; + unsigned int const minorVersion; + unsigned int const patchNumber; + + // buildNumber is only used if branchName is not null + char const * const branchName; + unsigned int const buildNumber; + + friend std::ostream& operator << ( std::ostream& os, Version const& version ); + + private: + void operator=( Version const& ); + }; + + inline Version libraryVersion(); +} + +#include +#include +#include + +namespace Catch { + + Ptr createReporter( std::string const& reporterName, Ptr const& config ) { + Ptr reporter = getRegistryHub().getReporterRegistry().create( reporterName, config.get() ); + if( !reporter ) { + std::ostringstream oss; + oss << "No reporter registered with name: '" << reporterName << "'"; + throw std::domain_error( oss.str() ); + } + return reporter; + } + +#if !defined(CATCH_CONFIG_DEFAULT_REPORTER) +#define CATCH_CONFIG_DEFAULT_REPORTER "console" +#endif + + Ptr makeReporter( Ptr const& config ) { + std::vector reporters = config->getReporterNames(); + if( reporters.empty() ) + reporters.push_back( CATCH_CONFIG_DEFAULT_REPORTER ); + + Ptr reporter; + for( std::vector::const_iterator it = reporters.begin(), itEnd = reporters.end(); + it != itEnd; + ++it ) + reporter = addReporter( reporter, createReporter( *it, config ) ); + return reporter; + } + Ptr addListeners( Ptr const& config, Ptr reporters ) { + IReporterRegistry::Listeners listeners = getRegistryHub().getReporterRegistry().getListeners(); + for( IReporterRegistry::Listeners::const_iterator it = listeners.begin(), itEnd = listeners.end(); + it != itEnd; + ++it ) + reporters = addReporter(reporters, (*it)->create( ReporterConfig( config ) ) ); + return reporters; + } + + Totals runTests( Ptr const& config ) { + + Ptr iconfig = config.get(); + + Ptr reporter = makeReporter( config ); + reporter = addListeners( iconfig, reporter ); + + RunContext context( iconfig, reporter ); + + Totals totals; + + context.testGroupStarting( config->name(), 1, 1 ); + + TestSpec testSpec = config->testSpec(); + if( !testSpec.hasFilters() ) + testSpec = TestSpecParser( ITagAliasRegistry::get() ).parse( "~[.]" ).testSpec(); // All not hidden tests + + std::vector const& allTestCases = getAllTestCasesSorted( *iconfig ); + for( std::vector::const_iterator it = allTestCases.begin(), itEnd = allTestCases.end(); + it != itEnd; + ++it ) { + if( !context.aborting() && matchTest( *it, testSpec, *iconfig ) ) + totals += context.runTest( *it ); + else + reporter->skipTest( *it ); + } + + context.testGroupEnded( iconfig->name(), totals, 1, 1 ); + return totals; + } + + void applyFilenamesAsTags( IConfig const& config ) { + std::vector const& tests = getAllTestCasesSorted( config ); + for(std::size_t i = 0; i < tests.size(); ++i ) { + TestCase& test = const_cast( tests[i] ); + std::set tags = test.tags; + + std::string filename = test.lineInfo.file; + std::string::size_type lastSlash = filename.find_last_of( "\\/" ); + if( lastSlash != std::string::npos ) + filename = filename.substr( lastSlash+1 ); + + std::string::size_type lastDot = filename.find_last_of( '.' ); + if( lastDot != std::string::npos ) + filename = filename.substr( 0, lastDot ); + + tags.insert( '#' + filename ); + setTags( test, tags ); + } + } + + class Session : NonCopyable { + static bool alreadyInstantiated; + + public: + + struct OnUnusedOptions { enum DoWhat { Ignore, Fail }; }; + + Session() + : m_cli( makeCommandLineParser() ) { + if( alreadyInstantiated ) { + std::string msg = "Only one instance of Catch::Session can ever be used"; + Catch::cerr() << msg << std::endl; + throw std::logic_error( msg ); + } + alreadyInstantiated = true; + } + ~Session() { + Catch::cleanUp(); + } + + void showHelp( std::string const& processName ) { + Catch::cout() << "\nCatch v" << libraryVersion() << "\n"; + + m_cli.usage( Catch::cout(), processName ); + Catch::cout() << "For more detail usage please see the project docs\n" << std::endl; + } + void libIdentify() { + Catch::cout() + << std::left << std::setw(16) << "description: " << "A Catch test executable\n" + << std::left << std::setw(16) << "category: " << "testframework\n" + << std::left << std::setw(16) << "framework: " << "Catch Test\n" + << std::left << std::setw(16) << "version: " << libraryVersion() << std::endl; + } + + int applyCommandLine( int argc, char const* const* const argv, OnUnusedOptions::DoWhat unusedOptionBehaviour = OnUnusedOptions::Fail ) { + try { + m_cli.setThrowOnUnrecognisedTokens( unusedOptionBehaviour == OnUnusedOptions::Fail ); + m_unusedTokens = m_cli.parseInto( Clara::argsToVector( argc, argv ), m_configData ); + if( m_configData.showHelp ) + showHelp( m_configData.processName ); + if( m_configData.libIdentify ) + libIdentify(); + m_config.reset(); + } + catch( std::exception& ex ) { + { + Colour colourGuard( Colour::Red ); + Catch::cerr() + << "\nError(s) in input:\n" + << Text( ex.what(), TextAttributes().setIndent(2) ) + << "\n\n"; + } + m_cli.usage( Catch::cout(), m_configData.processName ); + return (std::numeric_limits::max)(); + } + return 0; + } + + void useConfigData( ConfigData const& _configData ) { + m_configData = _configData; + m_config.reset(); + } + + int run( int argc, char const* const* const argv ) { + + int returnCode = applyCommandLine( argc, argv ); + if( returnCode == 0 ) + returnCode = run(); + return returnCode; + } + + #if defined(WIN32) && defined(UNICODE) + int run( int argc, wchar_t const* const* const argv ) { + + char **utf8Argv = new char *[ argc ]; + + for ( int i = 0; i < argc; ++i ) { + int bufSize = WideCharToMultiByte( CP_UTF8, 0, argv[i], -1, NULL, 0, NULL, NULL ); + + utf8Argv[ i ] = new char[ bufSize ]; + + WideCharToMultiByte( CP_UTF8, 0, argv[i], -1, utf8Argv[i], bufSize, NULL, NULL ); + } + + int returnCode = applyCommandLine( argc, utf8Argv ); + if( returnCode == 0 ) + returnCode = run(); + + for ( int i = 0; i < argc; ++i ) + delete [] utf8Argv[ i ]; + + delete [] utf8Argv; + + return returnCode; + } + #endif + + int run() { + if( ( m_configData.waitForKeypress & WaitForKeypress::BeforeStart ) != 0 ) { + Catch::cout() << "...waiting for enter/ return before starting" << std::endl; + static_cast(std::getchar()); + } + int exitCode = runInternal(); + if( ( m_configData.waitForKeypress & WaitForKeypress::BeforeExit ) != 0 ) { + Catch::cout() << "...waiting for enter/ return before exiting, with code: " << exitCode << std::endl; + static_cast(std::getchar()); + } + return exitCode; + } + + Clara::CommandLine const& cli() const { + return m_cli; + } + std::vector const& unusedTokens() const { + return m_unusedTokens; + } + ConfigData& configData() { + return m_configData; + } + Config& config() { + if( !m_config ) + m_config = new Config( m_configData ); + return *m_config; + } + private: + + int runInternal() { + if( m_configData.showHelp || m_configData.libIdentify ) + return 0; + + try + { + config(); // Force config to be constructed + + seedRng( *m_config ); + + if( m_configData.filenamesAsTags ) + applyFilenamesAsTags( *m_config ); + + // Handle list request + if( Option listed = list( config() ) ) + return static_cast( *listed ); + + return static_cast( runTests( m_config ).assertions.failed ); + } + catch( std::exception& ex ) { + Catch::cerr() << ex.what() << std::endl; + return (std::numeric_limits::max)(); + } + } + + Clara::CommandLine m_cli; + std::vector m_unusedTokens; + ConfigData m_configData; + Ptr m_config; + }; + + bool Session::alreadyInstantiated = false; + +} // end namespace Catch + +// #included from: catch_registry_hub.hpp +#define TWOBLUECUBES_CATCH_REGISTRY_HUB_HPP_INCLUDED + +// #included from: catch_test_case_registry_impl.hpp +#define TWOBLUECUBES_CATCH_TEST_CASE_REGISTRY_IMPL_HPP_INCLUDED + +#include +#include +#include +#include + +namespace Catch { + + struct RandomNumberGenerator { + typedef std::ptrdiff_t result_type; + + result_type operator()( result_type n ) const { return std::rand() % n; } + +#ifdef CATCH_CONFIG_CPP11_SHUFFLE + static constexpr result_type min() { return 0; } + static constexpr result_type max() { return 1000000; } + result_type operator()() const { return std::rand() % max(); } +#endif + template + static void shuffle( V& vector ) { + RandomNumberGenerator rng; +#ifdef CATCH_CONFIG_CPP11_SHUFFLE + std::shuffle( vector.begin(), vector.end(), rng ); +#else + std::random_shuffle( vector.begin(), vector.end(), rng ); +#endif + } + }; + + inline std::vector sortTests( IConfig const& config, std::vector const& unsortedTestCases ) { + + std::vector sorted = unsortedTestCases; + + switch( config.runOrder() ) { + case RunTests::InLexicographicalOrder: + std::sort( sorted.begin(), sorted.end() ); + break; + case RunTests::InRandomOrder: + { + seedRng( config ); + RandomNumberGenerator::shuffle( sorted ); + } + break; + case RunTests::InDeclarationOrder: + // already in declaration order + break; + } + return sorted; + } + bool matchTest( TestCase const& testCase, TestSpec const& testSpec, IConfig const& config ) { + return testSpec.matches( testCase ) && ( config.allowThrows() || !testCase.throws() ); + } + + void enforceNoDuplicateTestCases( std::vector const& functions ) { + std::set seenFunctions; + for( std::vector::const_iterator it = functions.begin(), itEnd = functions.end(); + it != itEnd; + ++it ) { + std::pair::const_iterator, bool> prev = seenFunctions.insert( *it ); + if( !prev.second ) { + std::ostringstream ss; + + ss << Colour( Colour::Red ) + << "error: TEST_CASE( \"" << it->name << "\" ) already defined.\n" + << "\tFirst seen at " << prev.first->getTestCaseInfo().lineInfo << '\n' + << "\tRedefined at " << it->getTestCaseInfo().lineInfo << std::endl; + + throw std::runtime_error(ss.str()); + } + } + } + + std::vector filterTests( std::vector const& testCases, TestSpec const& testSpec, IConfig const& config ) { + std::vector filtered; + filtered.reserve( testCases.size() ); + for( std::vector::const_iterator it = testCases.begin(), itEnd = testCases.end(); + it != itEnd; + ++it ) + if( matchTest( *it, testSpec, config ) ) + filtered.push_back( *it ); + return filtered; + } + std::vector const& getAllTestCasesSorted( IConfig const& config ) { + return getRegistryHub().getTestCaseRegistry().getAllTestsSorted( config ); + } + + class TestRegistry : public ITestCaseRegistry { + public: + TestRegistry() + : m_currentSortOrder( RunTests::InDeclarationOrder ), + m_unnamedCount( 0 ) + {} + virtual ~TestRegistry(); + + virtual void registerTest( TestCase const& testCase ) { + std::string name = testCase.getTestCaseInfo().name; + if( name.empty() ) { + std::ostringstream oss; + oss << "Anonymous test case " << ++m_unnamedCount; + return registerTest( testCase.withName( oss.str() ) ); + } + m_functions.push_back( testCase ); + } + + virtual std::vector const& getAllTests() const { + return m_functions; + } + virtual std::vector const& getAllTestsSorted( IConfig const& config ) const { + if( m_sortedFunctions.empty() ) + enforceNoDuplicateTestCases( m_functions ); + + if( m_currentSortOrder != config.runOrder() || m_sortedFunctions.empty() ) { + m_sortedFunctions = sortTests( config, m_functions ); + m_currentSortOrder = config.runOrder(); + } + return m_sortedFunctions; + } + + private: + std::vector m_functions; + mutable RunTests::InWhatOrder m_currentSortOrder; + mutable std::vector m_sortedFunctions; + size_t m_unnamedCount; + std::ios_base::Init m_ostreamInit; // Forces cout/ cerr to be initialised + }; + + /////////////////////////////////////////////////////////////////////////// + + class FreeFunctionTestCase : public SharedImpl { + public: + + FreeFunctionTestCase( TestFunction fun ) : m_fun( fun ) {} + + virtual void invoke() const { + m_fun(); + } + + private: + virtual ~FreeFunctionTestCase(); + + TestFunction m_fun; + }; + + inline std::string extractClassName( std::string const& classOrQualifiedMethodName ) { + std::string className = classOrQualifiedMethodName; + if( startsWith( className, '&' ) ) + { + std::size_t lastColons = className.rfind( "::" ); + std::size_t penultimateColons = className.rfind( "::", lastColons-1 ); + if( penultimateColons == std::string::npos ) + penultimateColons = 1; + className = className.substr( penultimateColons, lastColons-penultimateColons ); + } + return className; + } + + void registerTestCase + ( ITestCase* testCase, + char const* classOrQualifiedMethodName, + NameAndDesc const& nameAndDesc, + SourceLineInfo const& lineInfo ) { + + getMutableRegistryHub().registerTest + ( makeTestCase + ( testCase, + extractClassName( classOrQualifiedMethodName ), + nameAndDesc.name, + nameAndDesc.description, + lineInfo ) ); + } + void registerTestCaseFunction + ( TestFunction function, + SourceLineInfo const& lineInfo, + NameAndDesc const& nameAndDesc ) { + registerTestCase( new FreeFunctionTestCase( function ), "", nameAndDesc, lineInfo ); + } + + /////////////////////////////////////////////////////////////////////////// + + AutoReg::AutoReg + ( TestFunction function, + SourceLineInfo const& lineInfo, + NameAndDesc const& nameAndDesc ) { + registerTestCaseFunction( function, lineInfo, nameAndDesc ); + } + + AutoReg::~AutoReg() {} + +} // end namespace Catch + +// #included from: catch_reporter_registry.hpp +#define TWOBLUECUBES_CATCH_REPORTER_REGISTRY_HPP_INCLUDED + +#include + +namespace Catch { + + class ReporterRegistry : public IReporterRegistry { + + public: + + virtual ~ReporterRegistry() CATCH_OVERRIDE {} + + virtual IStreamingReporter* create( std::string const& name, Ptr const& config ) const CATCH_OVERRIDE { + FactoryMap::const_iterator it = m_factories.find( name ); + if( it == m_factories.end() ) + return CATCH_NULL; + return it->second->create( ReporterConfig( config ) ); + } + + void registerReporter( std::string const& name, Ptr const& factory ) { + m_factories.insert( std::make_pair( name, factory ) ); + } + void registerListener( Ptr const& factory ) { + m_listeners.push_back( factory ); + } + + virtual FactoryMap const& getFactories() const CATCH_OVERRIDE { + return m_factories; + } + virtual Listeners const& getListeners() const CATCH_OVERRIDE { + return m_listeners; + } + + private: + FactoryMap m_factories; + Listeners m_listeners; + }; +} + +// #included from: catch_exception_translator_registry.hpp +#define TWOBLUECUBES_CATCH_EXCEPTION_TRANSLATOR_REGISTRY_HPP_INCLUDED + +#ifdef __OBJC__ +#import "Foundation/Foundation.h" +#endif + +namespace Catch { + + class ExceptionTranslatorRegistry : public IExceptionTranslatorRegistry { + public: + ~ExceptionTranslatorRegistry() { + deleteAll( m_translators ); + } + + virtual void registerTranslator( const IExceptionTranslator* translator ) { + m_translators.push_back( translator ); + } + + virtual std::string translateActiveException() const { + try { +#ifdef __OBJC__ + // In Objective-C try objective-c exceptions first + @try { + return tryTranslators(); + } + @catch (NSException *exception) { + return Catch::toString( [exception description] ); + } +#else + return tryTranslators(); +#endif + } + catch( TestFailureException& ) { + throw; + } + catch( std::exception& ex ) { + return ex.what(); + } + catch( std::string& msg ) { + return msg; + } + catch( const char* msg ) { + return msg; + } + catch(...) { + return "Unknown exception"; + } + } + + std::string tryTranslators() const { + if( m_translators.empty() ) + throw; + else + return m_translators[0]->translate( m_translators.begin()+1, m_translators.end() ); + } + + private: + std::vector m_translators; + }; +} + +// #included from: catch_tag_alias_registry.h +#define TWOBLUECUBES_CATCH_TAG_ALIAS_REGISTRY_H_INCLUDED + +#include + +namespace Catch { + + class TagAliasRegistry : public ITagAliasRegistry { + public: + virtual ~TagAliasRegistry(); + virtual Option find( std::string const& alias ) const; + virtual std::string expandAliases( std::string const& unexpandedTestSpec ) const; + void add( std::string const& alias, std::string const& tag, SourceLineInfo const& lineInfo ); + + private: + std::map m_registry; + }; + +} // end namespace Catch + +namespace Catch { + + namespace { + + class RegistryHub : public IRegistryHub, public IMutableRegistryHub { + + RegistryHub( RegistryHub const& ); + void operator=( RegistryHub const& ); + + public: // IRegistryHub + RegistryHub() { + } + virtual IReporterRegistry const& getReporterRegistry() const CATCH_OVERRIDE { + return m_reporterRegistry; + } + virtual ITestCaseRegistry const& getTestCaseRegistry() const CATCH_OVERRIDE { + return m_testCaseRegistry; + } + virtual IExceptionTranslatorRegistry& getExceptionTranslatorRegistry() CATCH_OVERRIDE { + return m_exceptionTranslatorRegistry; + } + virtual ITagAliasRegistry const& getTagAliasRegistry() const CATCH_OVERRIDE { + return m_tagAliasRegistry; + } + + public: // IMutableRegistryHub + virtual void registerReporter( std::string const& name, Ptr const& factory ) CATCH_OVERRIDE { + m_reporterRegistry.registerReporter( name, factory ); + } + virtual void registerListener( Ptr const& factory ) CATCH_OVERRIDE { + m_reporterRegistry.registerListener( factory ); + } + virtual void registerTest( TestCase const& testInfo ) CATCH_OVERRIDE { + m_testCaseRegistry.registerTest( testInfo ); + } + virtual void registerTranslator( const IExceptionTranslator* translator ) CATCH_OVERRIDE { + m_exceptionTranslatorRegistry.registerTranslator( translator ); + } + virtual void registerTagAlias( std::string const& alias, std::string const& tag, SourceLineInfo const& lineInfo ) CATCH_OVERRIDE { + m_tagAliasRegistry.add( alias, tag, lineInfo ); + } + + private: + TestRegistry m_testCaseRegistry; + ReporterRegistry m_reporterRegistry; + ExceptionTranslatorRegistry m_exceptionTranslatorRegistry; + TagAliasRegistry m_tagAliasRegistry; + }; + + // Single, global, instance + inline RegistryHub*& getTheRegistryHub() { + static RegistryHub* theRegistryHub = CATCH_NULL; + if( !theRegistryHub ) + theRegistryHub = new RegistryHub(); + return theRegistryHub; + } + } + + IRegistryHub& getRegistryHub() { + return *getTheRegistryHub(); + } + IMutableRegistryHub& getMutableRegistryHub() { + return *getTheRegistryHub(); + } + void cleanUp() { + delete getTheRegistryHub(); + getTheRegistryHub() = CATCH_NULL; + cleanUpContext(); + } + std::string translateActiveException() { + return getRegistryHub().getExceptionTranslatorRegistry().translateActiveException(); + } + +} // end namespace Catch + +// #included from: catch_notimplemented_exception.hpp +#define TWOBLUECUBES_CATCH_NOTIMPLEMENTED_EXCEPTION_HPP_INCLUDED + +#include + +namespace Catch { + + NotImplementedException::NotImplementedException( SourceLineInfo const& lineInfo ) + : m_lineInfo( lineInfo ) { + std::ostringstream oss; + oss << lineInfo << ": function "; + oss << "not implemented"; + m_what = oss.str(); + } + + const char* NotImplementedException::what() const CATCH_NOEXCEPT { + return m_what.c_str(); + } + +} // end namespace Catch + +// #included from: catch_context_impl.hpp +#define TWOBLUECUBES_CATCH_CONTEXT_IMPL_HPP_INCLUDED + +// #included from: catch_stream.hpp +#define TWOBLUECUBES_CATCH_STREAM_HPP_INCLUDED + +#include +#include +#include + +namespace Catch { + + template + class StreamBufImpl : public StreamBufBase { + char data[bufferSize]; + WriterF m_writer; + + public: + StreamBufImpl() { + setp( data, data + sizeof(data) ); + } + + ~StreamBufImpl() CATCH_NOEXCEPT { + sync(); + } + + private: + int overflow( int c ) { + sync(); + + if( c != EOF ) { + if( pbase() == epptr() ) + m_writer( std::string( 1, static_cast( c ) ) ); + else + sputc( static_cast( c ) ); + } + return 0; + } + + int sync() { + if( pbase() != pptr() ) { + m_writer( std::string( pbase(), static_cast( pptr() - pbase() ) ) ); + setp( pbase(), epptr() ); + } + return 0; + } + }; + + /////////////////////////////////////////////////////////////////////////// + + FileStream::FileStream( std::string const& filename ) { + m_ofs.open( filename.c_str() ); + if( m_ofs.fail() ) { + std::ostringstream oss; + oss << "Unable to open file: '" << filename << '\''; + throw std::domain_error( oss.str() ); + } + } + + std::ostream& FileStream::stream() const { + return m_ofs; + } + + struct OutputDebugWriter { + + void operator()( std::string const&str ) { + writeToDebugConsole( str ); + } + }; + + DebugOutStream::DebugOutStream() + : m_streamBuf( new StreamBufImpl() ), + m_os( m_streamBuf.get() ) + {} + + std::ostream& DebugOutStream::stream() const { + return m_os; + } + + // Store the streambuf from cout up-front because + // cout may get redirected when running tests + CoutStream::CoutStream() + : m_os( Catch::cout().rdbuf() ) + {} + + std::ostream& CoutStream::stream() const { + return m_os; + } + +#ifndef CATCH_CONFIG_NOSTDOUT // If you #define this you must implement these functions + std::ostream& cout() { + return std::cout; + } + std::ostream& cerr() { + return std::cerr; + } + std::ostream& clog() { + return std::clog; + } +#endif +} + +namespace Catch { + + class Context : public IMutableContext { + + Context() : m_config( CATCH_NULL ), m_runner( CATCH_NULL ), m_resultCapture( CATCH_NULL ) {} + Context( Context const& ); + void operator=( Context const& ); + + public: + virtual ~Context() { + deleteAllValues( m_generatorsByTestName ); + } + + public: // IContext + virtual IResultCapture* getResultCapture() { + return m_resultCapture; + } + virtual IRunner* getRunner() { + return m_runner; + } + virtual size_t getGeneratorIndex( std::string const& fileInfo, size_t totalSize ) { + return getGeneratorsForCurrentTest() + .getGeneratorInfo( fileInfo, totalSize ) + .getCurrentIndex(); + } + virtual bool advanceGeneratorsForCurrentTest() { + IGeneratorsForTest* generators = findGeneratorsForCurrentTest(); + return generators && generators->moveNext(); + } + + virtual Ptr getConfig() const { + return m_config; + } + + public: // IMutableContext + virtual void setResultCapture( IResultCapture* resultCapture ) { + m_resultCapture = resultCapture; + } + virtual void setRunner( IRunner* runner ) { + m_runner = runner; + } + virtual void setConfig( Ptr const& config ) { + m_config = config; + } + + friend IMutableContext& getCurrentMutableContext(); + + private: + IGeneratorsForTest* findGeneratorsForCurrentTest() { + std::string testName = getResultCapture()->getCurrentTestName(); + + std::map::const_iterator it = + m_generatorsByTestName.find( testName ); + return it != m_generatorsByTestName.end() + ? it->second + : CATCH_NULL; + } + + IGeneratorsForTest& getGeneratorsForCurrentTest() { + IGeneratorsForTest* generators = findGeneratorsForCurrentTest(); + if( !generators ) { + std::string testName = getResultCapture()->getCurrentTestName(); + generators = createGeneratorsForTest(); + m_generatorsByTestName.insert( std::make_pair( testName, generators ) ); + } + return *generators; + } + + private: + Ptr m_config; + IRunner* m_runner; + IResultCapture* m_resultCapture; + std::map m_generatorsByTestName; + }; + + namespace { + Context* currentContext = CATCH_NULL; + } + IMutableContext& getCurrentMutableContext() { + if( !currentContext ) + currentContext = new Context(); + return *currentContext; + } + IContext& getCurrentContext() { + return getCurrentMutableContext(); + } + + void cleanUpContext() { + delete currentContext; + currentContext = CATCH_NULL; + } +} + +// #included from: catch_console_colour_impl.hpp +#define TWOBLUECUBES_CATCH_CONSOLE_COLOUR_IMPL_HPP_INCLUDED + +// #included from: catch_errno_guard.hpp +#define TWOBLUECUBES_CATCH_ERRNO_GUARD_HPP_INCLUDED + +#include + +namespace Catch { + + class ErrnoGuard { + public: + ErrnoGuard():m_oldErrno(errno){} + ~ErrnoGuard() { errno = m_oldErrno; } + private: + int m_oldErrno; + }; + +} + +namespace Catch { + namespace { + + struct IColourImpl { + virtual ~IColourImpl() {} + virtual void use( Colour::Code _colourCode ) = 0; + }; + + struct NoColourImpl : IColourImpl { + void use( Colour::Code ) {} + + static IColourImpl* instance() { + static NoColourImpl s_instance; + return &s_instance; + } + }; + + } // anon namespace +} // namespace Catch + +#if !defined( CATCH_CONFIG_COLOUR_NONE ) && !defined( CATCH_CONFIG_COLOUR_WINDOWS ) && !defined( CATCH_CONFIG_COLOUR_ANSI ) +# ifdef CATCH_PLATFORM_WINDOWS +# define CATCH_CONFIG_COLOUR_WINDOWS +# else +# define CATCH_CONFIG_COLOUR_ANSI +# endif +#endif + +#if defined ( CATCH_CONFIG_COLOUR_WINDOWS ) ///////////////////////////////////////// + +namespace Catch { +namespace { + + class Win32ColourImpl : public IColourImpl { + public: + Win32ColourImpl() : stdoutHandle( GetStdHandle(STD_OUTPUT_HANDLE) ) + { + CONSOLE_SCREEN_BUFFER_INFO csbiInfo; + GetConsoleScreenBufferInfo( stdoutHandle, &csbiInfo ); + originalForegroundAttributes = csbiInfo.wAttributes & ~( BACKGROUND_GREEN | BACKGROUND_RED | BACKGROUND_BLUE | BACKGROUND_INTENSITY ); + originalBackgroundAttributes = csbiInfo.wAttributes & ~( FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_INTENSITY ); + } + + virtual void use( Colour::Code _colourCode ) { + switch( _colourCode ) { + case Colour::None: return setTextAttribute( originalForegroundAttributes ); + case Colour::White: return setTextAttribute( FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE ); + case Colour::Red: return setTextAttribute( FOREGROUND_RED ); + case Colour::Green: return setTextAttribute( FOREGROUND_GREEN ); + case Colour::Blue: return setTextAttribute( FOREGROUND_BLUE ); + case Colour::Cyan: return setTextAttribute( FOREGROUND_BLUE | FOREGROUND_GREEN ); + case Colour::Yellow: return setTextAttribute( FOREGROUND_RED | FOREGROUND_GREEN ); + case Colour::Grey: return setTextAttribute( 0 ); + + case Colour::LightGrey: return setTextAttribute( FOREGROUND_INTENSITY ); + case Colour::BrightRed: return setTextAttribute( FOREGROUND_INTENSITY | FOREGROUND_RED ); + case Colour::BrightGreen: return setTextAttribute( FOREGROUND_INTENSITY | FOREGROUND_GREEN ); + case Colour::BrightWhite: return setTextAttribute( FOREGROUND_INTENSITY | FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE ); + + case Colour::Bright: throw std::logic_error( "not a colour" ); + } + } + + private: + void setTextAttribute( WORD _textAttribute ) { + SetConsoleTextAttribute( stdoutHandle, _textAttribute | originalBackgroundAttributes ); + } + HANDLE stdoutHandle; + WORD originalForegroundAttributes; + WORD originalBackgroundAttributes; + }; + + IColourImpl* platformColourInstance() { + static Win32ColourImpl s_instance; + + Ptr config = getCurrentContext().getConfig(); + UseColour::YesOrNo colourMode = config + ? config->useColour() + : UseColour::Auto; + if( colourMode == UseColour::Auto ) + colourMode = !isDebuggerActive() + ? UseColour::Yes + : UseColour::No; + return colourMode == UseColour::Yes + ? &s_instance + : NoColourImpl::instance(); + } + +} // end anon namespace +} // end namespace Catch + +#elif defined( CATCH_CONFIG_COLOUR_ANSI ) ////////////////////////////////////// + +#include + +namespace Catch { +namespace { + + // use POSIX/ ANSI console terminal codes + // Thanks to Adam Strzelecki for original contribution + // (http://github.com/nanoant) + // https://github.com/philsquared/Catch/pull/131 + class PosixColourImpl : public IColourImpl { + public: + virtual void use( Colour::Code _colourCode ) { + switch( _colourCode ) { + case Colour::None: + case Colour::White: return setColour( "[0m" ); + case Colour::Red: return setColour( "[0;31m" ); + case Colour::Green: return setColour( "[0;32m" ); + case Colour::Blue: return setColour( "[0;34m" ); + case Colour::Cyan: return setColour( "[0;36m" ); + case Colour::Yellow: return setColour( "[0;33m" ); + case Colour::Grey: return setColour( "[1;30m" ); + + case Colour::LightGrey: return setColour( "[0;37m" ); + case Colour::BrightRed: return setColour( "[1;31m" ); + case Colour::BrightGreen: return setColour( "[1;32m" ); + case Colour::BrightWhite: return setColour( "[1;37m" ); + + case Colour::Bright: throw std::logic_error( "not a colour" ); + } + } + static IColourImpl* instance() { + static PosixColourImpl s_instance; + return &s_instance; + } + + private: + void setColour( const char* _escapeCode ) { + Catch::cout() << '\033' << _escapeCode; + } + }; + + IColourImpl* platformColourInstance() { + ErrnoGuard guard; + Ptr config = getCurrentContext().getConfig(); + UseColour::YesOrNo colourMode = config + ? config->useColour() + : UseColour::Auto; + if( colourMode == UseColour::Auto ) + colourMode = (!isDebuggerActive() && isatty(STDOUT_FILENO) ) + ? UseColour::Yes + : UseColour::No; + return colourMode == UseColour::Yes + ? PosixColourImpl::instance() + : NoColourImpl::instance(); + } + +} // end anon namespace +} // end namespace Catch + +#else // not Windows or ANSI /////////////////////////////////////////////// + +namespace Catch { + + static IColourImpl* platformColourInstance() { return NoColourImpl::instance(); } + +} // end namespace Catch + +#endif // Windows/ ANSI/ None + +namespace Catch { + + Colour::Colour( Code _colourCode ) : m_moved( false ) { use( _colourCode ); } + Colour::Colour( Colour const& _other ) : m_moved( false ) { const_cast( _other ).m_moved = true; } + Colour::~Colour(){ if( !m_moved ) use( None ); } + + void Colour::use( Code _colourCode ) { + static IColourImpl* impl = platformColourInstance(); + impl->use( _colourCode ); + } + +} // end namespace Catch + +// #included from: catch_generators_impl.hpp +#define TWOBLUECUBES_CATCH_GENERATORS_IMPL_HPP_INCLUDED + +#include +#include +#include + +namespace Catch { + + struct GeneratorInfo : IGeneratorInfo { + + GeneratorInfo( std::size_t size ) + : m_size( size ), + m_currentIndex( 0 ) + {} + + bool moveNext() { + if( ++m_currentIndex == m_size ) { + m_currentIndex = 0; + return false; + } + return true; + } + + std::size_t getCurrentIndex() const { + return m_currentIndex; + } + + std::size_t m_size; + std::size_t m_currentIndex; + }; + + /////////////////////////////////////////////////////////////////////////// + + class GeneratorsForTest : public IGeneratorsForTest { + + public: + ~GeneratorsForTest() { + deleteAll( m_generatorsInOrder ); + } + + IGeneratorInfo& getGeneratorInfo( std::string const& fileInfo, std::size_t size ) { + std::map::const_iterator it = m_generatorsByName.find( fileInfo ); + if( it == m_generatorsByName.end() ) { + IGeneratorInfo* info = new GeneratorInfo( size ); + m_generatorsByName.insert( std::make_pair( fileInfo, info ) ); + m_generatorsInOrder.push_back( info ); + return *info; + } + return *it->second; + } + + bool moveNext() { + std::vector::const_iterator it = m_generatorsInOrder.begin(); + std::vector::const_iterator itEnd = m_generatorsInOrder.end(); + for(; it != itEnd; ++it ) { + if( (*it)->moveNext() ) + return true; + } + return false; + } + + private: + std::map m_generatorsByName; + std::vector m_generatorsInOrder; + }; + + IGeneratorsForTest* createGeneratorsForTest() + { + return new GeneratorsForTest(); + } + +} // end namespace Catch + +// #included from: catch_assertionresult.hpp +#define TWOBLUECUBES_CATCH_ASSERTIONRESULT_HPP_INCLUDED + +namespace Catch { + + AssertionInfo::AssertionInfo():macroName(""), capturedExpression(""), resultDisposition(ResultDisposition::Normal), secondArg(""){} + + AssertionInfo::AssertionInfo( char const * _macroName, + SourceLineInfo const& _lineInfo, + char const * _capturedExpression, + ResultDisposition::Flags _resultDisposition, + char const * _secondArg) + : macroName( _macroName ), + lineInfo( _lineInfo ), + capturedExpression( _capturedExpression ), + resultDisposition( _resultDisposition ), + secondArg( _secondArg ) + {} + + AssertionResult::AssertionResult() {} + + AssertionResult::AssertionResult( AssertionInfo const& info, AssertionResultData const& data ) + : m_info( info ), + m_resultData( data ) + {} + + AssertionResult::~AssertionResult() {} + + // Result was a success + bool AssertionResult::succeeded() const { + return Catch::isOk( m_resultData.resultType ); + } + + // Result was a success, or failure is suppressed + bool AssertionResult::isOk() const { + return Catch::isOk( m_resultData.resultType ) || shouldSuppressFailure( m_info.resultDisposition ); + } + + ResultWas::OfType AssertionResult::getResultType() const { + return m_resultData.resultType; + } + + bool AssertionResult::hasExpression() const { + return m_info.capturedExpression[0] != 0; + } + + bool AssertionResult::hasMessage() const { + return !m_resultData.message.empty(); + } + + std::string capturedExpressionWithSecondArgument( char const * capturedExpression, char const * secondArg ) { + return (secondArg[0] == 0 || secondArg[0] == '"' && secondArg[1] == '"') + ? capturedExpression + : std::string(capturedExpression) + ", " + secondArg; + } + + std::string AssertionResult::getExpression() const { + if( isFalseTest( m_info.resultDisposition ) ) + return '!' + capturedExpressionWithSecondArgument(m_info.capturedExpression, m_info.secondArg); + else + return capturedExpressionWithSecondArgument(m_info.capturedExpression, m_info.secondArg); + } + std::string AssertionResult::getExpressionInMacro() const { + if( m_info.macroName[0] == 0 ) + return capturedExpressionWithSecondArgument(m_info.capturedExpression, m_info.secondArg); + else + return std::string(m_info.macroName) + "( " + capturedExpressionWithSecondArgument(m_info.capturedExpression, m_info.secondArg) + " )"; + } + + bool AssertionResult::hasExpandedExpression() const { + return hasExpression() && getExpandedExpression() != getExpression(); + } + + std::string AssertionResult::getExpandedExpression() const { + return m_resultData.reconstructExpression(); + } + + std::string AssertionResult::getMessage() const { + return m_resultData.message; + } + SourceLineInfo AssertionResult::getSourceInfo() const { + return m_info.lineInfo; + } + + std::string AssertionResult::getTestMacroName() const { + return m_info.macroName; + } + + void AssertionResult::discardDecomposedExpression() const { + m_resultData.decomposedExpression = CATCH_NULL; + } + + void AssertionResult::expandDecomposedExpression() const { + m_resultData.reconstructExpression(); + } + +} // end namespace Catch + +// #included from: catch_test_case_info.hpp +#define TWOBLUECUBES_CATCH_TEST_CASE_INFO_HPP_INCLUDED + +#include + +namespace Catch { + + inline TestCaseInfo::SpecialProperties parseSpecialTag( std::string const& tag ) { + if( startsWith( tag, '.' ) || + tag == "hide" || + tag == "!hide" ) + return TestCaseInfo::IsHidden; + else if( tag == "!throws" ) + return TestCaseInfo::Throws; + else if( tag == "!shouldfail" ) + return TestCaseInfo::ShouldFail; + else if( tag == "!mayfail" ) + return TestCaseInfo::MayFail; + else if( tag == "!nonportable" ) + return TestCaseInfo::NonPortable; + else + return TestCaseInfo::None; + } + inline bool isReservedTag( std::string const& tag ) { + return parseSpecialTag( tag ) == TestCaseInfo::None && tag.size() > 0 && !std::isalnum( tag[0] ); + } + inline void enforceNotReservedTag( std::string const& tag, SourceLineInfo const& _lineInfo ) { + if( isReservedTag( tag ) ) { + std::ostringstream ss; + ss << Colour(Colour::Red) + << "Tag name [" << tag << "] not allowed.\n" + << "Tag names starting with non alpha-numeric characters are reserved\n" + << Colour(Colour::FileName) + << _lineInfo << '\n'; + throw std::runtime_error(ss.str()); + } + } + + TestCase makeTestCase( ITestCase* _testCase, + std::string const& _className, + std::string const& _name, + std::string const& _descOrTags, + SourceLineInfo const& _lineInfo ) + { + bool isHidden( startsWith( _name, "./" ) ); // Legacy support + + // Parse out tags + std::set tags; + std::string desc, tag; + bool inTag = false; + for( std::size_t i = 0; i < _descOrTags.size(); ++i ) { + char c = _descOrTags[i]; + if( !inTag ) { + if( c == '[' ) + inTag = true; + else + desc += c; + } + else { + if( c == ']' ) { + TestCaseInfo::SpecialProperties prop = parseSpecialTag( tag ); + if( prop == TestCaseInfo::IsHidden ) + isHidden = true; + else if( prop == TestCaseInfo::None ) + enforceNotReservedTag( tag, _lineInfo ); + + tags.insert( tag ); + tag.clear(); + inTag = false; + } + else + tag += c; + } + } + if( isHidden ) { + tags.insert( "hide" ); + tags.insert( "." ); + } + + TestCaseInfo info( _name, _className, desc, tags, _lineInfo ); + return TestCase( _testCase, info ); + } + + void setTags( TestCaseInfo& testCaseInfo, std::set const& tags ) + { + testCaseInfo.tags = tags; + testCaseInfo.lcaseTags.clear(); + + std::ostringstream oss; + for( std::set::const_iterator it = tags.begin(), itEnd = tags.end(); it != itEnd; ++it ) { + oss << '[' << *it << ']'; + std::string lcaseTag = toLower( *it ); + testCaseInfo.properties = static_cast( testCaseInfo.properties | parseSpecialTag( lcaseTag ) ); + testCaseInfo.lcaseTags.insert( lcaseTag ); + } + testCaseInfo.tagsAsString = oss.str(); + } + + TestCaseInfo::TestCaseInfo( std::string const& _name, + std::string const& _className, + std::string const& _description, + std::set const& _tags, + SourceLineInfo const& _lineInfo ) + : name( _name ), + className( _className ), + description( _description ), + lineInfo( _lineInfo ), + properties( None ) + { + setTags( *this, _tags ); + } + + TestCaseInfo::TestCaseInfo( TestCaseInfo const& other ) + : name( other.name ), + className( other.className ), + description( other.description ), + tags( other.tags ), + lcaseTags( other.lcaseTags ), + tagsAsString( other.tagsAsString ), + lineInfo( other.lineInfo ), + properties( other.properties ) + {} + + bool TestCaseInfo::isHidden() const { + return ( properties & IsHidden ) != 0; + } + bool TestCaseInfo::throws() const { + return ( properties & Throws ) != 0; + } + bool TestCaseInfo::okToFail() const { + return ( properties & (ShouldFail | MayFail ) ) != 0; + } + bool TestCaseInfo::expectedToFail() const { + return ( properties & (ShouldFail ) ) != 0; + } + + TestCase::TestCase( ITestCase* testCase, TestCaseInfo const& info ) : TestCaseInfo( info ), test( testCase ) {} + + TestCase::TestCase( TestCase const& other ) + : TestCaseInfo( other ), + test( other.test ) + {} + + TestCase TestCase::withName( std::string const& _newName ) const { + TestCase other( *this ); + other.name = _newName; + return other; + } + + void TestCase::swap( TestCase& other ) { + test.swap( other.test ); + name.swap( other.name ); + className.swap( other.className ); + description.swap( other.description ); + tags.swap( other.tags ); + lcaseTags.swap( other.lcaseTags ); + tagsAsString.swap( other.tagsAsString ); + std::swap( TestCaseInfo::properties, static_cast( other ).properties ); + std::swap( lineInfo, other.lineInfo ); + } + + void TestCase::invoke() const { + test->invoke(); + } + + bool TestCase::operator == ( TestCase const& other ) const { + return test.get() == other.test.get() && + name == other.name && + className == other.className; + } + + bool TestCase::operator < ( TestCase const& other ) const { + return name < other.name; + } + TestCase& TestCase::operator = ( TestCase const& other ) { + TestCase temp( other ); + swap( temp ); + return *this; + } + + TestCaseInfo const& TestCase::getTestCaseInfo() const + { + return *this; + } + +} // end namespace Catch + +// #included from: catch_version.hpp +#define TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED + +namespace Catch { + + Version::Version + ( unsigned int _majorVersion, + unsigned int _minorVersion, + unsigned int _patchNumber, + char const * const _branchName, + unsigned int _buildNumber ) + : majorVersion( _majorVersion ), + minorVersion( _minorVersion ), + patchNumber( _patchNumber ), + branchName( _branchName ), + buildNumber( _buildNumber ) + {} + + std::ostream& operator << ( std::ostream& os, Version const& version ) { + os << version.majorVersion << '.' + << version.minorVersion << '.' + << version.patchNumber; + // branchName is never null -> 0th char is \0 if it is empty + if (version.branchName[0]) { + os << '-' << version.branchName + << '.' << version.buildNumber; + } + return os; + } + + inline Version libraryVersion() { + static Version version( 1, 10, 0, "", 0 ); + return version; + } + +} + +// #included from: catch_message.hpp +#define TWOBLUECUBES_CATCH_MESSAGE_HPP_INCLUDED + +namespace Catch { + + MessageInfo::MessageInfo( std::string const& _macroName, + SourceLineInfo const& _lineInfo, + ResultWas::OfType _type ) + : macroName( _macroName ), + lineInfo( _lineInfo ), + type( _type ), + sequence( ++globalCount ) + {} + + // This may need protecting if threading support is added + unsigned int MessageInfo::globalCount = 0; + + //////////////////////////////////////////////////////////////////////////// + + ScopedMessage::ScopedMessage( MessageBuilder const& builder ) + : m_info( builder.m_info ) + { + m_info.message = builder.m_stream.str(); + getResultCapture().pushScopedMessage( m_info ); + } + ScopedMessage::ScopedMessage( ScopedMessage const& other ) + : m_info( other.m_info ) + {} + + ScopedMessage::~ScopedMessage() { + if ( !std::uncaught_exception() ){ + getResultCapture().popScopedMessage(m_info); + } + } + +} // end namespace Catch + +// #included from: catch_legacy_reporter_adapter.hpp +#define TWOBLUECUBES_CATCH_LEGACY_REPORTER_ADAPTER_HPP_INCLUDED + +// #included from: catch_legacy_reporter_adapter.h +#define TWOBLUECUBES_CATCH_LEGACY_REPORTER_ADAPTER_H_INCLUDED + +namespace Catch +{ + // Deprecated + struct IReporter : IShared { + virtual ~IReporter(); + + virtual bool shouldRedirectStdout() const = 0; + + virtual void StartTesting() = 0; + virtual void EndTesting( Totals const& totals ) = 0; + virtual void StartGroup( std::string const& groupName ) = 0; + virtual void EndGroup( std::string const& groupName, Totals const& totals ) = 0; + virtual void StartTestCase( TestCaseInfo const& testInfo ) = 0; + virtual void EndTestCase( TestCaseInfo const& testInfo, Totals const& totals, std::string const& stdOut, std::string const& stdErr ) = 0; + virtual void StartSection( std::string const& sectionName, std::string const& description ) = 0; + virtual void EndSection( std::string const& sectionName, Counts const& assertions ) = 0; + virtual void NoAssertionsInSection( std::string const& sectionName ) = 0; + virtual void NoAssertionsInTestCase( std::string const& testName ) = 0; + virtual void Aborted() = 0; + virtual void Result( AssertionResult const& result ) = 0; + }; + + class LegacyReporterAdapter : public SharedImpl + { + public: + LegacyReporterAdapter( Ptr const& legacyReporter ); + virtual ~LegacyReporterAdapter(); + + virtual ReporterPreferences getPreferences() const; + virtual void noMatchingTestCases( std::string const& ); + virtual void testRunStarting( TestRunInfo const& ); + virtual void testGroupStarting( GroupInfo const& groupInfo ); + virtual void testCaseStarting( TestCaseInfo const& testInfo ); + virtual void sectionStarting( SectionInfo const& sectionInfo ); + virtual void assertionStarting( AssertionInfo const& ); + virtual bool assertionEnded( AssertionStats const& assertionStats ); + virtual void sectionEnded( SectionStats const& sectionStats ); + virtual void testCaseEnded( TestCaseStats const& testCaseStats ); + virtual void testGroupEnded( TestGroupStats const& testGroupStats ); + virtual void testRunEnded( TestRunStats const& testRunStats ); + virtual void skipTest( TestCaseInfo const& ); + + private: + Ptr m_legacyReporter; + }; +} + +namespace Catch +{ + LegacyReporterAdapter::LegacyReporterAdapter( Ptr const& legacyReporter ) + : m_legacyReporter( legacyReporter ) + {} + LegacyReporterAdapter::~LegacyReporterAdapter() {} + + ReporterPreferences LegacyReporterAdapter::getPreferences() const { + ReporterPreferences prefs; + prefs.shouldRedirectStdOut = m_legacyReporter->shouldRedirectStdout(); + return prefs; + } + + void LegacyReporterAdapter::noMatchingTestCases( std::string const& ) {} + void LegacyReporterAdapter::testRunStarting( TestRunInfo const& ) { + m_legacyReporter->StartTesting(); + } + void LegacyReporterAdapter::testGroupStarting( GroupInfo const& groupInfo ) { + m_legacyReporter->StartGroup( groupInfo.name ); + } + void LegacyReporterAdapter::testCaseStarting( TestCaseInfo const& testInfo ) { + m_legacyReporter->StartTestCase( testInfo ); + } + void LegacyReporterAdapter::sectionStarting( SectionInfo const& sectionInfo ) { + m_legacyReporter->StartSection( sectionInfo.name, sectionInfo.description ); + } + void LegacyReporterAdapter::assertionStarting( AssertionInfo const& ) { + // Not on legacy interface + } + + bool LegacyReporterAdapter::assertionEnded( AssertionStats const& assertionStats ) { + if( assertionStats.assertionResult.getResultType() != ResultWas::Ok ) { + for( std::vector::const_iterator it = assertionStats.infoMessages.begin(), itEnd = assertionStats.infoMessages.end(); + it != itEnd; + ++it ) { + if( it->type == ResultWas::Info ) { + ResultBuilder rb( it->macroName.c_str(), it->lineInfo, "", ResultDisposition::Normal ); + rb << it->message; + rb.setResultType( ResultWas::Info ); + AssertionResult result = rb.build(); + m_legacyReporter->Result( result ); + } + } + } + m_legacyReporter->Result( assertionStats.assertionResult ); + return true; + } + void LegacyReporterAdapter::sectionEnded( SectionStats const& sectionStats ) { + if( sectionStats.missingAssertions ) + m_legacyReporter->NoAssertionsInSection( sectionStats.sectionInfo.name ); + m_legacyReporter->EndSection( sectionStats.sectionInfo.name, sectionStats.assertions ); + } + void LegacyReporterAdapter::testCaseEnded( TestCaseStats const& testCaseStats ) { + m_legacyReporter->EndTestCase + ( testCaseStats.testInfo, + testCaseStats.totals, + testCaseStats.stdOut, + testCaseStats.stdErr ); + } + void LegacyReporterAdapter::testGroupEnded( TestGroupStats const& testGroupStats ) { + if( testGroupStats.aborting ) + m_legacyReporter->Aborted(); + m_legacyReporter->EndGroup( testGroupStats.groupInfo.name, testGroupStats.totals ); + } + void LegacyReporterAdapter::testRunEnded( TestRunStats const& testRunStats ) { + m_legacyReporter->EndTesting( testRunStats.totals ); + } + void LegacyReporterAdapter::skipTest( TestCaseInfo const& ) { + } +} + +// #included from: catch_timer.hpp + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wc++11-long-long" +#endif + +#ifdef CATCH_PLATFORM_WINDOWS + +#else + +#include + +#endif + +namespace Catch { + + namespace { +#ifdef CATCH_PLATFORM_WINDOWS + UInt64 getCurrentTicks() { + static UInt64 hz=0, hzo=0; + if (!hz) { + QueryPerformanceFrequency( reinterpret_cast( &hz ) ); + QueryPerformanceCounter( reinterpret_cast( &hzo ) ); + } + UInt64 t; + QueryPerformanceCounter( reinterpret_cast( &t ) ); + return ((t-hzo)*1000000)/hz; + } +#else + UInt64 getCurrentTicks() { + timeval t; + gettimeofday(&t,CATCH_NULL); + return static_cast( t.tv_sec ) * 1000000ull + static_cast( t.tv_usec ); + } +#endif + } + + void Timer::start() { + m_ticks = getCurrentTicks(); + } + unsigned int Timer::getElapsedMicroseconds() const { + return static_cast(getCurrentTicks() - m_ticks); + } + unsigned int Timer::getElapsedMilliseconds() const { + return static_cast(getElapsedMicroseconds()/1000); + } + double Timer::getElapsedSeconds() const { + return getElapsedMicroseconds()/1000000.0; + } + +} // namespace Catch + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif +// #included from: catch_common.hpp +#define TWOBLUECUBES_CATCH_COMMON_HPP_INCLUDED + +#include +#include + +namespace Catch { + + bool startsWith( std::string const& s, std::string const& prefix ) { + return s.size() >= prefix.size() && std::equal(prefix.begin(), prefix.end(), s.begin()); + } + bool startsWith( std::string const& s, char prefix ) { + return !s.empty() && s[0] == prefix; + } + bool endsWith( std::string const& s, std::string const& suffix ) { + return s.size() >= suffix.size() && std::equal(suffix.rbegin(), suffix.rend(), s.rbegin()); + } + bool endsWith( std::string const& s, char suffix ) { + return !s.empty() && s[s.size()-1] == suffix; + } + bool contains( std::string const& s, std::string const& infix ) { + return s.find( infix ) != std::string::npos; + } + char toLowerCh(char c) { + return static_cast( std::tolower( c ) ); + } + void toLowerInPlace( std::string& s ) { + std::transform( s.begin(), s.end(), s.begin(), toLowerCh ); + } + std::string toLower( std::string const& s ) { + std::string lc = s; + toLowerInPlace( lc ); + return lc; + } + std::string trim( std::string const& str ) { + static char const* whitespaceChars = "\n\r\t "; + std::string::size_type start = str.find_first_not_of( whitespaceChars ); + std::string::size_type end = str.find_last_not_of( whitespaceChars ); + + return start != std::string::npos ? str.substr( start, 1+end-start ) : std::string(); + } + + bool replaceInPlace( std::string& str, std::string const& replaceThis, std::string const& withThis ) { + bool replaced = false; + std::size_t i = str.find( replaceThis ); + while( i != std::string::npos ) { + replaced = true; + str = str.substr( 0, i ) + withThis + str.substr( i+replaceThis.size() ); + if( i < str.size()-withThis.size() ) + i = str.find( replaceThis, i+withThis.size() ); + else + i = std::string::npos; + } + return replaced; + } + + pluralise::pluralise( std::size_t count, std::string const& label ) + : m_count( count ), + m_label( label ) + {} + + std::ostream& operator << ( std::ostream& os, pluralise const& pluraliser ) { + os << pluraliser.m_count << ' ' << pluraliser.m_label; + if( pluraliser.m_count != 1 ) + os << 's'; + return os; + } + + SourceLineInfo::SourceLineInfo() : file(""), line( 0 ){} + SourceLineInfo::SourceLineInfo( char const* _file, std::size_t _line ) + : file( _file ), + line( _line ) + {} + bool SourceLineInfo::empty() const { + return file[0] == '\0'; + } + bool SourceLineInfo::operator == ( SourceLineInfo const& other ) const { + return line == other.line && (file == other.file || std::strcmp(file, other.file) == 0); + } + bool SourceLineInfo::operator < ( SourceLineInfo const& other ) const { + return line < other.line || ( line == other.line && (std::strcmp(file, other.file) < 0)); + } + + void seedRng( IConfig const& config ) { + if( config.rngSeed() != 0 ) + std::srand( config.rngSeed() ); + } + unsigned int rngSeed() { + return getCurrentContext().getConfig()->rngSeed(); + } + + std::ostream& operator << ( std::ostream& os, SourceLineInfo const& info ) { +#ifndef __GNUG__ + os << info.file << '(' << info.line << ')'; +#else + os << info.file << ':' << info.line; +#endif + return os; + } + + void throwLogicError( std::string const& message, SourceLineInfo const& locationInfo ) { + std::ostringstream oss; + oss << locationInfo << ": Internal Catch error: '" << message << '\''; + if( alwaysTrue() ) + throw std::logic_error( oss.str() ); + } +} + +// #included from: catch_section.hpp +#define TWOBLUECUBES_CATCH_SECTION_HPP_INCLUDED + +namespace Catch { + + SectionInfo::SectionInfo + ( SourceLineInfo const& _lineInfo, + std::string const& _name, + std::string const& _description ) + : name( _name ), + description( _description ), + lineInfo( _lineInfo ) + {} + + Section::Section( SectionInfo const& info ) + : m_info( info ), + m_sectionIncluded( getResultCapture().sectionStarted( m_info, m_assertions ) ) + { + m_timer.start(); + } + +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable:4996) // std::uncaught_exception is deprecated in C++17 +#endif + Section::~Section() { + if( m_sectionIncluded ) { + SectionEndInfo endInfo( m_info, m_assertions, m_timer.getElapsedSeconds() ); + if( std::uncaught_exception() ) + getResultCapture().sectionEndedEarly( endInfo ); + else + getResultCapture().sectionEnded( endInfo ); + } + } +#if defined(_MSC_VER) +#pragma warning(pop) +#endif + + // This indicates whether the section should be executed or not + Section::operator bool() const { + return m_sectionIncluded; + } + +} // end namespace Catch + +// #included from: catch_debugger.hpp +#define TWOBLUECUBES_CATCH_DEBUGGER_HPP_INCLUDED + +#ifdef CATCH_PLATFORM_MAC + + #include + #include + #include + #include + #include + + namespace Catch{ + + // The following function is taken directly from the following technical note: + // http://developer.apple.com/library/mac/#qa/qa2004/qa1361.html + + // Returns true if the current process is being debugged (either + // running under the debugger or has a debugger attached post facto). + bool isDebuggerActive(){ + + int mib[4]; + struct kinfo_proc info; + size_t size; + + // Initialize the flags so that, if sysctl fails for some bizarre + // reason, we get a predictable result. + + info.kp_proc.p_flag = 0; + + // Initialize mib, which tells sysctl the info we want, in this case + // we're looking for information about a specific process ID. + + mib[0] = CTL_KERN; + mib[1] = KERN_PROC; + mib[2] = KERN_PROC_PID; + mib[3] = getpid(); + + // Call sysctl. + + size = sizeof(info); + if( sysctl(mib, sizeof(mib) / sizeof(*mib), &info, &size, CATCH_NULL, 0) != 0 ) { + Catch::cerr() << "\n** Call to sysctl failed - unable to determine if debugger is active **\n" << std::endl; + return false; + } + + // We're being debugged if the P_TRACED flag is set. + + return ( (info.kp_proc.p_flag & P_TRACED) != 0 ); + } + } // namespace Catch + +#elif defined(CATCH_PLATFORM_LINUX) + #include + #include + + namespace Catch{ + // The standard POSIX way of detecting a debugger is to attempt to + // ptrace() the process, but this needs to be done from a child and not + // this process itself to still allow attaching to this process later + // if wanted, so is rather heavy. Under Linux we have the PID of the + // "debugger" (which doesn't need to be gdb, of course, it could also + // be strace, for example) in /proc/$PID/status, so just get it from + // there instead. + bool isDebuggerActive(){ + // Libstdc++ has a bug, where std::ifstream sets errno to 0 + // This way our users can properly assert over errno values + ErrnoGuard guard; + std::ifstream in("/proc/self/status"); + for( std::string line; std::getline(in, line); ) { + static const int PREFIX_LEN = 11; + if( line.compare(0, PREFIX_LEN, "TracerPid:\t") == 0 ) { + // We're traced if the PID is not 0 and no other PID starts + // with 0 digit, so it's enough to check for just a single + // character. + return line.length() > PREFIX_LEN && line[PREFIX_LEN] != '0'; + } + } + + return false; + } + } // namespace Catch +#elif defined(_MSC_VER) + extern "C" __declspec(dllimport) int __stdcall IsDebuggerPresent(); + namespace Catch { + bool isDebuggerActive() { + return IsDebuggerPresent() != 0; + } + } +#elif defined(__MINGW32__) + extern "C" __declspec(dllimport) int __stdcall IsDebuggerPresent(); + namespace Catch { + bool isDebuggerActive() { + return IsDebuggerPresent() != 0; + } + } +#else + namespace Catch { + inline bool isDebuggerActive() { return false; } + } +#endif // Platform + +#ifdef CATCH_PLATFORM_WINDOWS + + namespace Catch { + void writeToDebugConsole( std::string const& text ) { + ::OutputDebugStringA( text.c_str() ); + } + } +#else + namespace Catch { + void writeToDebugConsole( std::string const& text ) { + // !TBD: Need a version for Mac/ XCode and other IDEs + Catch::cout() << text; + } + } +#endif // Platform + +// #included from: catch_tostring.hpp +#define TWOBLUECUBES_CATCH_TOSTRING_HPP_INCLUDED + +namespace Catch { + +namespace Detail { + + const std::string unprintableString = "{?}"; + + namespace { + const int hexThreshold = 255; + + struct Endianness { + enum Arch { Big, Little }; + + static Arch which() { + union _{ + int asInt; + char asChar[sizeof (int)]; + } u; + + u.asInt = 1; + return ( u.asChar[sizeof(int)-1] == 1 ) ? Big : Little; + } + }; + } + + std::string rawMemoryToString( const void *object, std::size_t size ) + { + // Reverse order for little endian architectures + int i = 0, end = static_cast( size ), inc = 1; + if( Endianness::which() == Endianness::Little ) { + i = end-1; + end = inc = -1; + } + + unsigned char const *bytes = static_cast(object); + std::ostringstream os; + os << "0x" << std::setfill('0') << std::hex; + for( ; i != end; i += inc ) + os << std::setw(2) << static_cast(bytes[i]); + return os.str(); + } +} + +std::string toString( std::string const& value ) { + std::string s = value; + if( getCurrentContext().getConfig()->showInvisibles() ) { + for(size_t i = 0; i < s.size(); ++i ) { + std::string subs; + switch( s[i] ) { + case '\n': subs = "\\n"; break; + case '\t': subs = "\\t"; break; + default: break; + } + if( !subs.empty() ) { + s = s.substr( 0, i ) + subs + s.substr( i+1 ); + ++i; + } + } + } + return '"' + s + '"'; +} +std::string toString( std::wstring const& value ) { + + std::string s; + s.reserve( value.size() ); + for(size_t i = 0; i < value.size(); ++i ) + s += value[i] <= 0xff ? static_cast( value[i] ) : '?'; + return Catch::toString( s ); +} + +std::string toString( const char* const value ) { + return value ? Catch::toString( std::string( value ) ) : std::string( "{null string}" ); +} + +std::string toString( char* const value ) { + return Catch::toString( static_cast( value ) ); +} + +std::string toString( const wchar_t* const value ) +{ + return value ? Catch::toString( std::wstring(value) ) : std::string( "{null string}" ); +} + +std::string toString( wchar_t* const value ) +{ + return Catch::toString( static_cast( value ) ); +} + +std::string toString( int value ) { + std::ostringstream oss; + oss << value; + if( value > Detail::hexThreshold ) + oss << " (0x" << std::hex << value << ')'; + return oss.str(); +} + +std::string toString( unsigned long value ) { + std::ostringstream oss; + oss << value; + if( value > Detail::hexThreshold ) + oss << " (0x" << std::hex << value << ')'; + return oss.str(); +} + +std::string toString( unsigned int value ) { + return Catch::toString( static_cast( value ) ); +} + +template +std::string fpToString( T value, int precision ) { + std::ostringstream oss; + oss << std::setprecision( precision ) + << std::fixed + << value; + std::string d = oss.str(); + std::size_t i = d.find_last_not_of( '0' ); + if( i != std::string::npos && i != d.size()-1 ) { + if( d[i] == '.' ) + i++; + d = d.substr( 0, i+1 ); + } + return d; +} + +std::string toString( const double value ) { + return fpToString( value, 10 ); +} +std::string toString( const float value ) { + return fpToString( value, 5 ) + 'f'; +} + +std::string toString( bool value ) { + return value ? "true" : "false"; +} + +std::string toString( char value ) { + if ( value == '\r' ) + return "'\\r'"; + if ( value == '\f' ) + return "'\\f'"; + if ( value == '\n' ) + return "'\\n'"; + if ( value == '\t' ) + return "'\\t'"; + if ( '\0' <= value && value < ' ' ) + return toString( static_cast( value ) ); + char chstr[] = "' '"; + chstr[1] = value; + return chstr; +} + +std::string toString( signed char value ) { + return toString( static_cast( value ) ); +} + +std::string toString( unsigned char value ) { + return toString( static_cast( value ) ); +} + +#ifdef CATCH_CONFIG_CPP11_LONG_LONG +std::string toString( long long value ) { + std::ostringstream oss; + oss << value; + if( value > Detail::hexThreshold ) + oss << " (0x" << std::hex << value << ')'; + return oss.str(); +} +std::string toString( unsigned long long value ) { + std::ostringstream oss; + oss << value; + if( value > Detail::hexThreshold ) + oss << " (0x" << std::hex << value << ')'; + return oss.str(); +} +#endif + +#ifdef CATCH_CONFIG_CPP11_NULLPTR +std::string toString( std::nullptr_t ) { + return "nullptr"; +} +#endif + +#ifdef __OBJC__ + std::string toString( NSString const * const& nsstring ) { + if( !nsstring ) + return "nil"; + return "@" + toString([nsstring UTF8String]); + } + std::string toString( NSString * CATCH_ARC_STRONG & nsstring ) { + if( !nsstring ) + return "nil"; + return "@" + toString([nsstring UTF8String]); + } + std::string toString( NSObject* const& nsObject ) { + return toString( [nsObject description] ); + } +#endif + +} // end namespace Catch + +// #included from: catch_result_builder.hpp +#define TWOBLUECUBES_CATCH_RESULT_BUILDER_HPP_INCLUDED + +namespace Catch { + + ResultBuilder::ResultBuilder( char const* macroName, + SourceLineInfo const& lineInfo, + char const* capturedExpression, + ResultDisposition::Flags resultDisposition, + char const* secondArg ) + : m_assertionInfo( macroName, lineInfo, capturedExpression, resultDisposition, secondArg ), + m_shouldDebugBreak( false ), + m_shouldThrow( false ), + m_guardException( false ), + m_usedStream( false ) + {} + + ResultBuilder::~ResultBuilder() { +#if defined(CATCH_CONFIG_FAST_COMPILE) + if ( m_guardException ) { + stream().oss << "Exception translation was disabled by CATCH_CONFIG_FAST_COMPILE"; + captureResult( ResultWas::ThrewException ); + getCurrentContext().getResultCapture()->exceptionEarlyReported(); + } +#endif + } + + ResultBuilder& ResultBuilder::setResultType( ResultWas::OfType result ) { + m_data.resultType = result; + return *this; + } + ResultBuilder& ResultBuilder::setResultType( bool result ) { + m_data.resultType = result ? ResultWas::Ok : ResultWas::ExpressionFailed; + return *this; + } + + void ResultBuilder::endExpression( DecomposedExpression const& expr ) { + // Flip bool results if FalseTest flag is set + if( isFalseTest( m_assertionInfo.resultDisposition ) ) { + m_data.negate( expr.isBinaryExpression() ); + } + + getResultCapture().assertionRun(); + + if(getCurrentContext().getConfig()->includeSuccessfulResults() || m_data.resultType != ResultWas::Ok) + { + AssertionResult result = build( expr ); + handleResult( result ); + } + else + getResultCapture().assertionPassed(); + } + + void ResultBuilder::useActiveException( ResultDisposition::Flags resultDisposition ) { + m_assertionInfo.resultDisposition = resultDisposition; + stream().oss << Catch::translateActiveException(); + captureResult( ResultWas::ThrewException ); + } + + void ResultBuilder::captureResult( ResultWas::OfType resultType ) { + setResultType( resultType ); + captureExpression(); + } + + void ResultBuilder::captureExpectedException( std::string const& expectedMessage ) { + if( expectedMessage.empty() ) + captureExpectedException( Matchers::Impl::MatchAllOf() ); + else + captureExpectedException( Matchers::Equals( expectedMessage ) ); + } + + void ResultBuilder::captureExpectedException( Matchers::Impl::MatcherBase const& matcher ) { + + assert( !isFalseTest( m_assertionInfo.resultDisposition ) ); + AssertionResultData data = m_data; + data.resultType = ResultWas::Ok; + data.reconstructedExpression = capturedExpressionWithSecondArgument(m_assertionInfo.capturedExpression, m_assertionInfo.secondArg); + + std::string actualMessage = Catch::translateActiveException(); + if( !matcher.match( actualMessage ) ) { + data.resultType = ResultWas::ExpressionFailed; + data.reconstructedExpression = actualMessage; + } + AssertionResult result( m_assertionInfo, data ); + handleResult( result ); + } + + void ResultBuilder::captureExpression() { + AssertionResult result = build(); + handleResult( result ); + } + + void ResultBuilder::handleResult( AssertionResult const& result ) + { + getResultCapture().assertionEnded( result ); + + if( !result.isOk() ) { + if( getCurrentContext().getConfig()->shouldDebugBreak() ) + m_shouldDebugBreak = true; + if( getCurrentContext().getRunner()->aborting() || (m_assertionInfo.resultDisposition & ResultDisposition::Normal) ) + m_shouldThrow = true; + } + } + + void ResultBuilder::react() { +#if defined(CATCH_CONFIG_FAST_COMPILE) + if (m_shouldDebugBreak) { + /////////////////////////////////////////////////////////////////// + // To inspect the state during test, you need to go one level up the callstack + // To go back to the test and change execution, jump over the throw statement + /////////////////////////////////////////////////////////////////// + CATCH_BREAK_INTO_DEBUGGER(); + } +#endif + if( m_shouldThrow ) + throw Catch::TestFailureException(); + } + + bool ResultBuilder::shouldDebugBreak() const { return m_shouldDebugBreak; } + bool ResultBuilder::allowThrows() const { return getCurrentContext().getConfig()->allowThrows(); } + + AssertionResult ResultBuilder::build() const + { + return build( *this ); + } + + // CAVEAT: The returned AssertionResult stores a pointer to the argument expr, + // a temporary DecomposedExpression, which in turn holds references to + // operands, possibly temporary as well. + // It should immediately be passed to handleResult; if the expression + // needs to be reported, its string expansion must be composed before + // the temporaries are destroyed. + AssertionResult ResultBuilder::build( DecomposedExpression const& expr ) const + { + assert( m_data.resultType != ResultWas::Unknown ); + AssertionResultData data = m_data; + + if(m_usedStream) + data.message = m_stream().oss.str(); + data.decomposedExpression = &expr; // for lazy reconstruction + return AssertionResult( m_assertionInfo, data ); + } + + void ResultBuilder::reconstructExpression( std::string& dest ) const { + dest = capturedExpressionWithSecondArgument(m_assertionInfo.capturedExpression, m_assertionInfo.secondArg); + } + + void ResultBuilder::setExceptionGuard() { + m_guardException = true; + } + void ResultBuilder::unsetExceptionGuard() { + m_guardException = false; + } + +} // end namespace Catch + +// #included from: catch_tag_alias_registry.hpp +#define TWOBLUECUBES_CATCH_TAG_ALIAS_REGISTRY_HPP_INCLUDED + +namespace Catch { + + TagAliasRegistry::~TagAliasRegistry() {} + + Option TagAliasRegistry::find( std::string const& alias ) const { + std::map::const_iterator it = m_registry.find( alias ); + if( it != m_registry.end() ) + return it->second; + else + return Option(); + } + + std::string TagAliasRegistry::expandAliases( std::string const& unexpandedTestSpec ) const { + std::string expandedTestSpec = unexpandedTestSpec; + for( std::map::const_iterator it = m_registry.begin(), itEnd = m_registry.end(); + it != itEnd; + ++it ) { + std::size_t pos = expandedTestSpec.find( it->first ); + if( pos != std::string::npos ) { + expandedTestSpec = expandedTestSpec.substr( 0, pos ) + + it->second.tag + + expandedTestSpec.substr( pos + it->first.size() ); + } + } + return expandedTestSpec; + } + + void TagAliasRegistry::add( std::string const& alias, std::string const& tag, SourceLineInfo const& lineInfo ) { + + if( !startsWith( alias, "[@" ) || !endsWith( alias, ']' ) ) { + std::ostringstream oss; + oss << Colour( Colour::Red ) + << "error: tag alias, \"" << alias << "\" is not of the form [@alias name].\n" + << Colour( Colour::FileName ) + << lineInfo << '\n'; + throw std::domain_error( oss.str().c_str() ); + } + if( !m_registry.insert( std::make_pair( alias, TagAlias( tag, lineInfo ) ) ).second ) { + std::ostringstream oss; + oss << Colour( Colour::Red ) + << "error: tag alias, \"" << alias << "\" already registered.\n" + << "\tFirst seen at " + << Colour( Colour::Red ) << find(alias)->lineInfo << '\n' + << Colour( Colour::Red ) << "\tRedefined at " + << Colour( Colour::FileName) << lineInfo << '\n'; + throw std::domain_error( oss.str().c_str() ); + } + } + + ITagAliasRegistry::~ITagAliasRegistry() {} + + ITagAliasRegistry const& ITagAliasRegistry::get() { + return getRegistryHub().getTagAliasRegistry(); + } + + RegistrarForTagAliases::RegistrarForTagAliases( char const* alias, char const* tag, SourceLineInfo const& lineInfo ) { + getMutableRegistryHub().registerTagAlias( alias, tag, lineInfo ); + } + +} // end namespace Catch + +// #included from: catch_matchers_string.hpp + +namespace Catch { +namespace Matchers { + + namespace StdString { + + CasedString::CasedString( std::string const& str, CaseSensitive::Choice caseSensitivity ) + : m_caseSensitivity( caseSensitivity ), + m_str( adjustString( str ) ) + {} + std::string CasedString::adjustString( std::string const& str ) const { + return m_caseSensitivity == CaseSensitive::No + ? toLower( str ) + : str; + } + std::string CasedString::caseSensitivitySuffix() const { + return m_caseSensitivity == CaseSensitive::No + ? " (case insensitive)" + : std::string(); + } + + StringMatcherBase::StringMatcherBase( std::string const& operation, CasedString const& comparator ) + : m_comparator( comparator ), + m_operation( operation ) { + } + + std::string StringMatcherBase::describe() const { + std::string description; + description.reserve(5 + m_operation.size() + m_comparator.m_str.size() + + m_comparator.caseSensitivitySuffix().size()); + description += m_operation; + description += ": \""; + description += m_comparator.m_str; + description += "\""; + description += m_comparator.caseSensitivitySuffix(); + return description; + } + + EqualsMatcher::EqualsMatcher( CasedString const& comparator ) : StringMatcherBase( "equals", comparator ) {} + + bool EqualsMatcher::match( std::string const& source ) const { + return m_comparator.adjustString( source ) == m_comparator.m_str; + } + + ContainsMatcher::ContainsMatcher( CasedString const& comparator ) : StringMatcherBase( "contains", comparator ) {} + + bool ContainsMatcher::match( std::string const& source ) const { + return contains( m_comparator.adjustString( source ), m_comparator.m_str ); + } + + StartsWithMatcher::StartsWithMatcher( CasedString const& comparator ) : StringMatcherBase( "starts with", comparator ) {} + + bool StartsWithMatcher::match( std::string const& source ) const { + return startsWith( m_comparator.adjustString( source ), m_comparator.m_str ); + } + + EndsWithMatcher::EndsWithMatcher( CasedString const& comparator ) : StringMatcherBase( "ends with", comparator ) {} + + bool EndsWithMatcher::match( std::string const& source ) const { + return endsWith( m_comparator.adjustString( source ), m_comparator.m_str ); + } + + } // namespace StdString + + StdString::EqualsMatcher Equals( std::string const& str, CaseSensitive::Choice caseSensitivity ) { + return StdString::EqualsMatcher( StdString::CasedString( str, caseSensitivity) ); + } + StdString::ContainsMatcher Contains( std::string const& str, CaseSensitive::Choice caseSensitivity ) { + return StdString::ContainsMatcher( StdString::CasedString( str, caseSensitivity) ); + } + StdString::EndsWithMatcher EndsWith( std::string const& str, CaseSensitive::Choice caseSensitivity ) { + return StdString::EndsWithMatcher( StdString::CasedString( str, caseSensitivity) ); + } + StdString::StartsWithMatcher StartsWith( std::string const& str, CaseSensitive::Choice caseSensitivity ) { + return StdString::StartsWithMatcher( StdString::CasedString( str, caseSensitivity) ); + } + +} // namespace Matchers +} // namespace Catch +// #included from: ../reporters/catch_reporter_multi.hpp +#define TWOBLUECUBES_CATCH_REPORTER_MULTI_HPP_INCLUDED + +namespace Catch { + +class MultipleReporters : public SharedImpl { + typedef std::vector > Reporters; + Reporters m_reporters; + +public: + void add( Ptr const& reporter ) { + m_reporters.push_back( reporter ); + } + +public: // IStreamingReporter + + virtual ReporterPreferences getPreferences() const CATCH_OVERRIDE { + return m_reporters[0]->getPreferences(); + } + + virtual void noMatchingTestCases( std::string const& spec ) CATCH_OVERRIDE { + for( Reporters::const_iterator it = m_reporters.begin(), itEnd = m_reporters.end(); + it != itEnd; + ++it ) + (*it)->noMatchingTestCases( spec ); + } + + virtual void testRunStarting( TestRunInfo const& testRunInfo ) CATCH_OVERRIDE { + for( Reporters::const_iterator it = m_reporters.begin(), itEnd = m_reporters.end(); + it != itEnd; + ++it ) + (*it)->testRunStarting( testRunInfo ); + } + + virtual void testGroupStarting( GroupInfo const& groupInfo ) CATCH_OVERRIDE { + for( Reporters::const_iterator it = m_reporters.begin(), itEnd = m_reporters.end(); + it != itEnd; + ++it ) + (*it)->testGroupStarting( groupInfo ); + } + + virtual void testCaseStarting( TestCaseInfo const& testInfo ) CATCH_OVERRIDE { + for( Reporters::const_iterator it = m_reporters.begin(), itEnd = m_reporters.end(); + it != itEnd; + ++it ) + (*it)->testCaseStarting( testInfo ); + } + + virtual void sectionStarting( SectionInfo const& sectionInfo ) CATCH_OVERRIDE { + for( Reporters::const_iterator it = m_reporters.begin(), itEnd = m_reporters.end(); + it != itEnd; + ++it ) + (*it)->sectionStarting( sectionInfo ); + } + + virtual void assertionStarting( AssertionInfo const& assertionInfo ) CATCH_OVERRIDE { + for( Reporters::const_iterator it = m_reporters.begin(), itEnd = m_reporters.end(); + it != itEnd; + ++it ) + (*it)->assertionStarting( assertionInfo ); + } + + // The return value indicates if the messages buffer should be cleared: + virtual bool assertionEnded( AssertionStats const& assertionStats ) CATCH_OVERRIDE { + bool clearBuffer = false; + for( Reporters::const_iterator it = m_reporters.begin(), itEnd = m_reporters.end(); + it != itEnd; + ++it ) + clearBuffer |= (*it)->assertionEnded( assertionStats ); + return clearBuffer; + } + + virtual void sectionEnded( SectionStats const& sectionStats ) CATCH_OVERRIDE { + for( Reporters::const_iterator it = m_reporters.begin(), itEnd = m_reporters.end(); + it != itEnd; + ++it ) + (*it)->sectionEnded( sectionStats ); + } + + virtual void testCaseEnded( TestCaseStats const& testCaseStats ) CATCH_OVERRIDE { + for( Reporters::const_iterator it = m_reporters.begin(), itEnd = m_reporters.end(); + it != itEnd; + ++it ) + (*it)->testCaseEnded( testCaseStats ); + } + + virtual void testGroupEnded( TestGroupStats const& testGroupStats ) CATCH_OVERRIDE { + for( Reporters::const_iterator it = m_reporters.begin(), itEnd = m_reporters.end(); + it != itEnd; + ++it ) + (*it)->testGroupEnded( testGroupStats ); + } + + virtual void testRunEnded( TestRunStats const& testRunStats ) CATCH_OVERRIDE { + for( Reporters::const_iterator it = m_reporters.begin(), itEnd = m_reporters.end(); + it != itEnd; + ++it ) + (*it)->testRunEnded( testRunStats ); + } + + virtual void skipTest( TestCaseInfo const& testInfo ) CATCH_OVERRIDE { + for( Reporters::const_iterator it = m_reporters.begin(), itEnd = m_reporters.end(); + it != itEnd; + ++it ) + (*it)->skipTest( testInfo ); + } + + virtual MultipleReporters* tryAsMulti() CATCH_OVERRIDE { + return this; + } + +}; + +Ptr addReporter( Ptr const& existingReporter, Ptr const& additionalReporter ) { + Ptr resultingReporter; + + if( existingReporter ) { + MultipleReporters* multi = existingReporter->tryAsMulti(); + if( !multi ) { + multi = new MultipleReporters; + resultingReporter = Ptr( multi ); + if( existingReporter ) + multi->add( existingReporter ); + } + else + resultingReporter = existingReporter; + multi->add( additionalReporter ); + } + else + resultingReporter = additionalReporter; + + return resultingReporter; +} + +} // end namespace Catch + +// #included from: ../reporters/catch_reporter_xml.hpp +#define TWOBLUECUBES_CATCH_REPORTER_XML_HPP_INCLUDED + +// #included from: catch_reporter_bases.hpp +#define TWOBLUECUBES_CATCH_REPORTER_BASES_HPP_INCLUDED + +#include +#include +#include +#include + +namespace Catch { + + namespace { + // Because formatting using c++ streams is stateful, drop down to C is required + // Alternatively we could use stringstream, but its performance is... not good. + std::string getFormattedDuration( double duration ) { + // Max exponent + 1 is required to represent the whole part + // + 1 for decimal point + // + 3 for the 3 decimal places + // + 1 for null terminator + const size_t maxDoubleSize = DBL_MAX_10_EXP + 1 + 1 + 3 + 1; + char buffer[maxDoubleSize]; + + // Save previous errno, to prevent sprintf from overwriting it + ErrnoGuard guard; +#ifdef _MSC_VER + sprintf_s(buffer, "%.3f", duration); +#else + sprintf(buffer, "%.3f", duration); +#endif + return std::string(buffer); + } + } + + struct StreamingReporterBase : SharedImpl { + + StreamingReporterBase( ReporterConfig const& _config ) + : m_config( _config.fullConfig() ), + stream( _config.stream() ) + { + m_reporterPrefs.shouldRedirectStdOut = false; + } + + virtual ReporterPreferences getPreferences() const CATCH_OVERRIDE { + return m_reporterPrefs; + } + + virtual ~StreamingReporterBase() CATCH_OVERRIDE; + + virtual void noMatchingTestCases( std::string const& ) CATCH_OVERRIDE {} + + virtual void testRunStarting( TestRunInfo const& _testRunInfo ) CATCH_OVERRIDE { + currentTestRunInfo = _testRunInfo; + } + virtual void testGroupStarting( GroupInfo const& _groupInfo ) CATCH_OVERRIDE { + currentGroupInfo = _groupInfo; + } + + virtual void testCaseStarting( TestCaseInfo const& _testInfo ) CATCH_OVERRIDE { + currentTestCaseInfo = _testInfo; + } + virtual void sectionStarting( SectionInfo const& _sectionInfo ) CATCH_OVERRIDE { + m_sectionStack.push_back( _sectionInfo ); + } + + virtual void sectionEnded( SectionStats const& /* _sectionStats */ ) CATCH_OVERRIDE { + m_sectionStack.pop_back(); + } + virtual void testCaseEnded( TestCaseStats const& /* _testCaseStats */ ) CATCH_OVERRIDE { + currentTestCaseInfo.reset(); + } + virtual void testGroupEnded( TestGroupStats const& /* _testGroupStats */ ) CATCH_OVERRIDE { + currentGroupInfo.reset(); + } + virtual void testRunEnded( TestRunStats const& /* _testRunStats */ ) CATCH_OVERRIDE { + currentTestCaseInfo.reset(); + currentGroupInfo.reset(); + currentTestRunInfo.reset(); + } + + virtual void skipTest( TestCaseInfo const& ) CATCH_OVERRIDE { + // Don't do anything with this by default. + // It can optionally be overridden in the derived class. + } + + Ptr m_config; + std::ostream& stream; + + LazyStat currentTestRunInfo; + LazyStat currentGroupInfo; + LazyStat currentTestCaseInfo; + + std::vector m_sectionStack; + ReporterPreferences m_reporterPrefs; + }; + + struct CumulativeReporterBase : SharedImpl { + template + struct Node : SharedImpl<> { + explicit Node( T const& _value ) : value( _value ) {} + virtual ~Node() {} + + typedef std::vector > ChildNodes; + T value; + ChildNodes children; + }; + struct SectionNode : SharedImpl<> { + explicit SectionNode( SectionStats const& _stats ) : stats( _stats ) {} + virtual ~SectionNode(); + + bool operator == ( SectionNode const& other ) const { + return stats.sectionInfo.lineInfo == other.stats.sectionInfo.lineInfo; + } + bool operator == ( Ptr const& other ) const { + return operator==( *other ); + } + + SectionStats stats; + typedef std::vector > ChildSections; + typedef std::vector Assertions; + ChildSections childSections; + Assertions assertions; + std::string stdOut; + std::string stdErr; + }; + + struct BySectionInfo { + BySectionInfo( SectionInfo const& other ) : m_other( other ) {} + BySectionInfo( BySectionInfo const& other ) : m_other( other.m_other ) {} + bool operator() ( Ptr const& node ) const { + return ((node->stats.sectionInfo.name == m_other.name) && + (node->stats.sectionInfo.lineInfo == m_other.lineInfo)); + } + private: + void operator=( BySectionInfo const& ); + SectionInfo const& m_other; + }; + + typedef Node TestCaseNode; + typedef Node TestGroupNode; + typedef Node TestRunNode; + + CumulativeReporterBase( ReporterConfig const& _config ) + : m_config( _config.fullConfig() ), + stream( _config.stream() ) + { + m_reporterPrefs.shouldRedirectStdOut = false; + } + ~CumulativeReporterBase(); + + virtual ReporterPreferences getPreferences() const CATCH_OVERRIDE { + return m_reporterPrefs; + } + + virtual void testRunStarting( TestRunInfo const& ) CATCH_OVERRIDE {} + virtual void testGroupStarting( GroupInfo const& ) CATCH_OVERRIDE {} + + virtual void testCaseStarting( TestCaseInfo const& ) CATCH_OVERRIDE {} + + virtual void sectionStarting( SectionInfo const& sectionInfo ) CATCH_OVERRIDE { + SectionStats incompleteStats( sectionInfo, Counts(), 0, false ); + Ptr node; + if( m_sectionStack.empty() ) { + if( !m_rootSection ) + m_rootSection = new SectionNode( incompleteStats ); + node = m_rootSection; + } + else { + SectionNode& parentNode = *m_sectionStack.back(); + SectionNode::ChildSections::const_iterator it = + std::find_if( parentNode.childSections.begin(), + parentNode.childSections.end(), + BySectionInfo( sectionInfo ) ); + if( it == parentNode.childSections.end() ) { + node = new SectionNode( incompleteStats ); + parentNode.childSections.push_back( node ); + } + else + node = *it; + } + m_sectionStack.push_back( node ); + m_deepestSection = node; + } + + virtual void assertionStarting( AssertionInfo const& ) CATCH_OVERRIDE {} + + virtual bool assertionEnded( AssertionStats const& assertionStats ) CATCH_OVERRIDE { + assert( !m_sectionStack.empty() ); + SectionNode& sectionNode = *m_sectionStack.back(); + sectionNode.assertions.push_back( assertionStats ); + // AssertionResult holds a pointer to a temporary DecomposedExpression, + // which getExpandedExpression() calls to build the expression string. + // Our section stack copy of the assertionResult will likely outlive the + // temporary, so it must be expanded or discarded now to avoid calling + // a destroyed object later. + prepareExpandedExpression( sectionNode.assertions.back().assertionResult ); + return true; + } + virtual void sectionEnded( SectionStats const& sectionStats ) CATCH_OVERRIDE { + assert( !m_sectionStack.empty() ); + SectionNode& node = *m_sectionStack.back(); + node.stats = sectionStats; + m_sectionStack.pop_back(); + } + virtual void testCaseEnded( TestCaseStats const& testCaseStats ) CATCH_OVERRIDE { + Ptr node = new TestCaseNode( testCaseStats ); + assert( m_sectionStack.size() == 0 ); + node->children.push_back( m_rootSection ); + m_testCases.push_back( node ); + m_rootSection.reset(); + + assert( m_deepestSection ); + m_deepestSection->stdOut = testCaseStats.stdOut; + m_deepestSection->stdErr = testCaseStats.stdErr; + } + virtual void testGroupEnded( TestGroupStats const& testGroupStats ) CATCH_OVERRIDE { + Ptr node = new TestGroupNode( testGroupStats ); + node->children.swap( m_testCases ); + m_testGroups.push_back( node ); + } + virtual void testRunEnded( TestRunStats const& testRunStats ) CATCH_OVERRIDE { + Ptr node = new TestRunNode( testRunStats ); + node->children.swap( m_testGroups ); + m_testRuns.push_back( node ); + testRunEndedCumulative(); + } + virtual void testRunEndedCumulative() = 0; + + virtual void skipTest( TestCaseInfo const& ) CATCH_OVERRIDE {} + + virtual void prepareExpandedExpression( AssertionResult& result ) const { + if( result.isOk() ) + result.discardDecomposedExpression(); + else + result.expandDecomposedExpression(); + } + + Ptr m_config; + std::ostream& stream; + std::vector m_assertions; + std::vector > > m_sections; + std::vector > m_testCases; + std::vector > m_testGroups; + + std::vector > m_testRuns; + + Ptr m_rootSection; + Ptr m_deepestSection; + std::vector > m_sectionStack; + ReporterPreferences m_reporterPrefs; + + }; + + template + char const* getLineOfChars() { + static char line[CATCH_CONFIG_CONSOLE_WIDTH] = {0}; + if( !*line ) { + std::memset( line, C, CATCH_CONFIG_CONSOLE_WIDTH-1 ); + line[CATCH_CONFIG_CONSOLE_WIDTH-1] = 0; + } + return line; + } + + struct TestEventListenerBase : StreamingReporterBase { + TestEventListenerBase( ReporterConfig const& _config ) + : StreamingReporterBase( _config ) + {} + + virtual void assertionStarting( AssertionInfo const& ) CATCH_OVERRIDE {} + virtual bool assertionEnded( AssertionStats const& ) CATCH_OVERRIDE { + return false; + } + }; + +} // end namespace Catch + +// #included from: ../internal/catch_reporter_registrars.hpp +#define TWOBLUECUBES_CATCH_REPORTER_REGISTRARS_HPP_INCLUDED + +namespace Catch { + + template + class LegacyReporterRegistrar { + + class ReporterFactory : public IReporterFactory { + virtual IStreamingReporter* create( ReporterConfig const& config ) const { + return new LegacyReporterAdapter( new T( config ) ); + } + + virtual std::string getDescription() const { + return T::getDescription(); + } + }; + + public: + + LegacyReporterRegistrar( std::string const& name ) { + getMutableRegistryHub().registerReporter( name, new ReporterFactory() ); + } + }; + + template + class ReporterRegistrar { + + class ReporterFactory : public SharedImpl { + + // *** Please Note ***: + // - If you end up here looking at a compiler error because it's trying to register + // your custom reporter class be aware that the native reporter interface has changed + // to IStreamingReporter. The "legacy" interface, IReporter, is still supported via + // an adapter. Just use REGISTER_LEGACY_REPORTER to take advantage of the adapter. + // However please consider updating to the new interface as the old one is now + // deprecated and will probably be removed quite soon! + // Please contact me via github if you have any questions at all about this. + // In fact, ideally, please contact me anyway to let me know you've hit this - as I have + // no idea who is actually using custom reporters at all (possibly no-one!). + // The new interface is designed to minimise exposure to interface changes in the future. + virtual IStreamingReporter* create( ReporterConfig const& config ) const { + return new T( config ); + } + + virtual std::string getDescription() const { + return T::getDescription(); + } + }; + + public: + + ReporterRegistrar( std::string const& name ) { + getMutableRegistryHub().registerReporter( name, new ReporterFactory() ); + } + }; + + template + class ListenerRegistrar { + + class ListenerFactory : public SharedImpl { + + virtual IStreamingReporter* create( ReporterConfig const& config ) const { + return new T( config ); + } + virtual std::string getDescription() const { + return std::string(); + } + }; + + public: + + ListenerRegistrar() { + getMutableRegistryHub().registerListener( new ListenerFactory() ); + } + }; +} + +#define INTERNAL_CATCH_REGISTER_LEGACY_REPORTER( name, reporterType ) \ + namespace{ Catch::LegacyReporterRegistrar catch_internal_RegistrarFor##reporterType( name ); } + +#define INTERNAL_CATCH_REGISTER_REPORTER( name, reporterType ) \ + namespace{ Catch::ReporterRegistrar catch_internal_RegistrarFor##reporterType( name ); } + +// Deprecated - use the form without INTERNAL_ +#define INTERNAL_CATCH_REGISTER_LISTENER( listenerType ) \ + namespace{ Catch::ListenerRegistrar catch_internal_RegistrarFor##listenerType; } + +#define CATCH_REGISTER_LISTENER( listenerType ) \ + namespace{ Catch::ListenerRegistrar catch_internal_RegistrarFor##listenerType; } + +// #included from: ../internal/catch_xmlwriter.hpp +#define TWOBLUECUBES_CATCH_XMLWRITER_HPP_INCLUDED + +#include +#include +#include +#include + +namespace Catch { + + class XmlEncode { + public: + enum ForWhat { ForTextNodes, ForAttributes }; + + XmlEncode( std::string const& str, ForWhat forWhat = ForTextNodes ) + : m_str( str ), + m_forWhat( forWhat ) + {} + + void encodeTo( std::ostream& os ) const { + + // Apostrophe escaping not necessary if we always use " to write attributes + // (see: http://www.w3.org/TR/xml/#syntax) + + for( std::size_t i = 0; i < m_str.size(); ++ i ) { + char c = m_str[i]; + switch( c ) { + case '<': os << "<"; break; + case '&': os << "&"; break; + + case '>': + // See: http://www.w3.org/TR/xml/#syntax + if( i > 2 && m_str[i-1] == ']' && m_str[i-2] == ']' ) + os << ">"; + else + os << c; + break; + + case '\"': + if( m_forWhat == ForAttributes ) + os << """; + else + os << c; + break; + + default: + // Escape control chars - based on contribution by @espenalb in PR #465 and + // by @mrpi PR #588 + if ( ( c >= 0 && c < '\x09' ) || ( c > '\x0D' && c < '\x20') || c=='\x7F' ) { + // see http://stackoverflow.com/questions/404107/why-are-control-characters-illegal-in-xml-1-0 + os << "\\x" << std::uppercase << std::hex << std::setfill('0') << std::setw(2) + << static_cast( c ); + } + else + os << c; + } + } + } + + friend std::ostream& operator << ( std::ostream& os, XmlEncode const& xmlEncode ) { + xmlEncode.encodeTo( os ); + return os; + } + + private: + std::string m_str; + ForWhat m_forWhat; + }; + + class XmlWriter { + public: + + class ScopedElement { + public: + ScopedElement( XmlWriter* writer ) + : m_writer( writer ) + {} + + ScopedElement( ScopedElement const& other ) + : m_writer( other.m_writer ){ + other.m_writer = CATCH_NULL; + } + + ~ScopedElement() { + if( m_writer ) + m_writer->endElement(); + } + + ScopedElement& writeText( std::string const& text, bool indent = true ) { + m_writer->writeText( text, indent ); + return *this; + } + + template + ScopedElement& writeAttribute( std::string const& name, T const& attribute ) { + m_writer->writeAttribute( name, attribute ); + return *this; + } + + private: + mutable XmlWriter* m_writer; + }; + + XmlWriter() + : m_tagIsOpen( false ), + m_needsNewline( false ), + m_os( Catch::cout() ) + { + writeDeclaration(); + } + + XmlWriter( std::ostream& os ) + : m_tagIsOpen( false ), + m_needsNewline( false ), + m_os( os ) + { + writeDeclaration(); + } + + ~XmlWriter() { + while( !m_tags.empty() ) + endElement(); + } + + XmlWriter& startElement( std::string const& name ) { + ensureTagClosed(); + newlineIfNecessary(); + m_os << m_indent << '<' << name; + m_tags.push_back( name ); + m_indent += " "; + m_tagIsOpen = true; + return *this; + } + + ScopedElement scopedElement( std::string const& name ) { + ScopedElement scoped( this ); + startElement( name ); + return scoped; + } + + XmlWriter& endElement() { + newlineIfNecessary(); + m_indent = m_indent.substr( 0, m_indent.size()-2 ); + if( m_tagIsOpen ) { + m_os << "/>"; + m_tagIsOpen = false; + } + else { + m_os << m_indent << ""; + } + m_os << std::endl; + m_tags.pop_back(); + return *this; + } + + XmlWriter& writeAttribute( std::string const& name, std::string const& attribute ) { + if( !name.empty() && !attribute.empty() ) + m_os << ' ' << name << "=\"" << XmlEncode( attribute, XmlEncode::ForAttributes ) << '"'; + return *this; + } + + XmlWriter& writeAttribute( std::string const& name, bool attribute ) { + m_os << ' ' << name << "=\"" << ( attribute ? "true" : "false" ) << '"'; + return *this; + } + + template + XmlWriter& writeAttribute( std::string const& name, T const& attribute ) { + std::ostringstream oss; + oss << attribute; + return writeAttribute( name, oss.str() ); + } + + XmlWriter& writeText( std::string const& text, bool indent = true ) { + if( !text.empty() ){ + bool tagWasOpen = m_tagIsOpen; + ensureTagClosed(); + if( tagWasOpen && indent ) + m_os << m_indent; + m_os << XmlEncode( text ); + m_needsNewline = true; + } + return *this; + } + + XmlWriter& writeComment( std::string const& text ) { + ensureTagClosed(); + m_os << m_indent << ""; + m_needsNewline = true; + return *this; + } + + void writeStylesheetRef( std::string const& url ) { + m_os << "\n"; + } + + XmlWriter& writeBlankLine() { + ensureTagClosed(); + m_os << '\n'; + return *this; + } + + void ensureTagClosed() { + if( m_tagIsOpen ) { + m_os << ">" << std::endl; + m_tagIsOpen = false; + } + } + + private: + XmlWriter( XmlWriter const& ); + void operator=( XmlWriter const& ); + + void writeDeclaration() { + m_os << "\n"; + } + + void newlineIfNecessary() { + if( m_needsNewline ) { + m_os << std::endl; + m_needsNewline = false; + } + } + + bool m_tagIsOpen; + bool m_needsNewline; + std::vector m_tags; + std::string m_indent; + std::ostream& m_os; + }; + +} + +namespace Catch { + class XmlReporter : public StreamingReporterBase { + public: + XmlReporter( ReporterConfig const& _config ) + : StreamingReporterBase( _config ), + m_xml(_config.stream()), + m_sectionDepth( 0 ) + { + m_reporterPrefs.shouldRedirectStdOut = true; + } + + virtual ~XmlReporter() CATCH_OVERRIDE; + + static std::string getDescription() { + return "Reports test results as an XML document"; + } + + virtual std::string getStylesheetRef() const { + return std::string(); + } + + void writeSourceInfo( SourceLineInfo const& sourceInfo ) { + m_xml + .writeAttribute( "filename", sourceInfo.file ) + .writeAttribute( "line", sourceInfo.line ); + } + + public: // StreamingReporterBase + + virtual void noMatchingTestCases( std::string const& s ) CATCH_OVERRIDE { + StreamingReporterBase::noMatchingTestCases( s ); + } + + virtual void testRunStarting( TestRunInfo const& testInfo ) CATCH_OVERRIDE { + StreamingReporterBase::testRunStarting( testInfo ); + std::string stylesheetRef = getStylesheetRef(); + if( !stylesheetRef.empty() ) + m_xml.writeStylesheetRef( stylesheetRef ); + m_xml.startElement( "Catch" ); + if( !m_config->name().empty() ) + m_xml.writeAttribute( "name", m_config->name() ); + } + + virtual void testGroupStarting( GroupInfo const& groupInfo ) CATCH_OVERRIDE { + StreamingReporterBase::testGroupStarting( groupInfo ); + m_xml.startElement( "Group" ) + .writeAttribute( "name", groupInfo.name ); + } + + virtual void testCaseStarting( TestCaseInfo const& testInfo ) CATCH_OVERRIDE { + StreamingReporterBase::testCaseStarting(testInfo); + m_xml.startElement( "TestCase" ) + .writeAttribute( "name", trim( testInfo.name ) ) + .writeAttribute( "description", testInfo.description ) + .writeAttribute( "tags", testInfo.tagsAsString ); + + writeSourceInfo( testInfo.lineInfo ); + + if ( m_config->showDurations() == ShowDurations::Always ) + m_testCaseTimer.start(); + m_xml.ensureTagClosed(); + } + + virtual void sectionStarting( SectionInfo const& sectionInfo ) CATCH_OVERRIDE { + StreamingReporterBase::sectionStarting( sectionInfo ); + if( m_sectionDepth++ > 0 ) { + m_xml.startElement( "Section" ) + .writeAttribute( "name", trim( sectionInfo.name ) ) + .writeAttribute( "description", sectionInfo.description ); + writeSourceInfo( sectionInfo.lineInfo ); + m_xml.ensureTagClosed(); + } + } + + virtual void assertionStarting( AssertionInfo const& ) CATCH_OVERRIDE { } + + virtual bool assertionEnded( AssertionStats const& assertionStats ) CATCH_OVERRIDE { + + AssertionResult const& result = assertionStats.assertionResult; + + bool includeResults = m_config->includeSuccessfulResults() || !result.isOk(); + + if( includeResults ) { + // Print any info messages in tags. + for( std::vector::const_iterator it = assertionStats.infoMessages.begin(), itEnd = assertionStats.infoMessages.end(); + it != itEnd; + ++it ) { + if( it->type == ResultWas::Info ) { + m_xml.scopedElement( "Info" ) + .writeText( it->message ); + } else if ( it->type == ResultWas::Warning ) { + m_xml.scopedElement( "Warning" ) + .writeText( it->message ); + } + } + } + + // Drop out if result was successful but we're not printing them. + if( !includeResults && result.getResultType() != ResultWas::Warning ) + return true; + + // Print the expression if there is one. + if( result.hasExpression() ) { + m_xml.startElement( "Expression" ) + .writeAttribute( "success", result.succeeded() ) + .writeAttribute( "type", result.getTestMacroName() ); + + writeSourceInfo( result.getSourceInfo() ); + + m_xml.scopedElement( "Original" ) + .writeText( result.getExpression() ); + m_xml.scopedElement( "Expanded" ) + .writeText( result.getExpandedExpression() ); + } + + // And... Print a result applicable to each result type. + switch( result.getResultType() ) { + case ResultWas::ThrewException: + m_xml.startElement( "Exception" ); + writeSourceInfo( result.getSourceInfo() ); + m_xml.writeText( result.getMessage() ); + m_xml.endElement(); + break; + case ResultWas::FatalErrorCondition: + m_xml.startElement( "FatalErrorCondition" ); + writeSourceInfo( result.getSourceInfo() ); + m_xml.writeText( result.getMessage() ); + m_xml.endElement(); + break; + case ResultWas::Info: + m_xml.scopedElement( "Info" ) + .writeText( result.getMessage() ); + break; + case ResultWas::Warning: + // Warning will already have been written + break; + case ResultWas::ExplicitFailure: + m_xml.startElement( "Failure" ); + writeSourceInfo( result.getSourceInfo() ); + m_xml.writeText( result.getMessage() ); + m_xml.endElement(); + break; + default: + break; + } + + if( result.hasExpression() ) + m_xml.endElement(); + + return true; + } + + virtual void sectionEnded( SectionStats const& sectionStats ) CATCH_OVERRIDE { + StreamingReporterBase::sectionEnded( sectionStats ); + if( --m_sectionDepth > 0 ) { + XmlWriter::ScopedElement e = m_xml.scopedElement( "OverallResults" ); + e.writeAttribute( "successes", sectionStats.assertions.passed ); + e.writeAttribute( "failures", sectionStats.assertions.failed ); + e.writeAttribute( "expectedFailures", sectionStats.assertions.failedButOk ); + + if ( m_config->showDurations() == ShowDurations::Always ) + e.writeAttribute( "durationInSeconds", sectionStats.durationInSeconds ); + + m_xml.endElement(); + } + } + + virtual void testCaseEnded( TestCaseStats const& testCaseStats ) CATCH_OVERRIDE { + StreamingReporterBase::testCaseEnded( testCaseStats ); + XmlWriter::ScopedElement e = m_xml.scopedElement( "OverallResult" ); + e.writeAttribute( "success", testCaseStats.totals.assertions.allOk() ); + + if ( m_config->showDurations() == ShowDurations::Always ) + e.writeAttribute( "durationInSeconds", m_testCaseTimer.getElapsedSeconds() ); + + if( !testCaseStats.stdOut.empty() ) + m_xml.scopedElement( "StdOut" ).writeText( trim( testCaseStats.stdOut ), false ); + if( !testCaseStats.stdErr.empty() ) + m_xml.scopedElement( "StdErr" ).writeText( trim( testCaseStats.stdErr ), false ); + + m_xml.endElement(); + } + + virtual void testGroupEnded( TestGroupStats const& testGroupStats ) CATCH_OVERRIDE { + StreamingReporterBase::testGroupEnded( testGroupStats ); + // TODO: Check testGroupStats.aborting and act accordingly. + m_xml.scopedElement( "OverallResults" ) + .writeAttribute( "successes", testGroupStats.totals.assertions.passed ) + .writeAttribute( "failures", testGroupStats.totals.assertions.failed ) + .writeAttribute( "expectedFailures", testGroupStats.totals.assertions.failedButOk ); + m_xml.endElement(); + } + + virtual void testRunEnded( TestRunStats const& testRunStats ) CATCH_OVERRIDE { + StreamingReporterBase::testRunEnded( testRunStats ); + m_xml.scopedElement( "OverallResults" ) + .writeAttribute( "successes", testRunStats.totals.assertions.passed ) + .writeAttribute( "failures", testRunStats.totals.assertions.failed ) + .writeAttribute( "expectedFailures", testRunStats.totals.assertions.failedButOk ); + m_xml.endElement(); + } + + private: + Timer m_testCaseTimer; + XmlWriter m_xml; + int m_sectionDepth; + }; + + INTERNAL_CATCH_REGISTER_REPORTER( "xml", XmlReporter ) + +} // end namespace Catch + +// #included from: ../reporters/catch_reporter_junit.hpp +#define TWOBLUECUBES_CATCH_REPORTER_JUNIT_HPP_INCLUDED + +#include + +namespace Catch { + + namespace { + std::string getCurrentTimestamp() { + // Beware, this is not reentrant because of backward compatibility issues + // Also, UTC only, again because of backward compatibility (%z is C++11) + time_t rawtime; + std::time(&rawtime); + const size_t timeStampSize = sizeof("2017-01-16T17:06:45Z"); + +#ifdef _MSC_VER + std::tm timeInfo = {}; + gmtime_s(&timeInfo, &rawtime); +#else + std::tm* timeInfo; + timeInfo = std::gmtime(&rawtime); +#endif + + char timeStamp[timeStampSize]; + const char * const fmt = "%Y-%m-%dT%H:%M:%SZ"; + +#ifdef _MSC_VER + std::strftime(timeStamp, timeStampSize, fmt, &timeInfo); +#else + std::strftime(timeStamp, timeStampSize, fmt, timeInfo); +#endif + return std::string(timeStamp); + } + + } + + class JunitReporter : public CumulativeReporterBase { + public: + JunitReporter( ReporterConfig const& _config ) + : CumulativeReporterBase( _config ), + xml( _config.stream() ), + unexpectedExceptions( 0 ), + m_okToFail( false ) + { + m_reporterPrefs.shouldRedirectStdOut = true; + } + + virtual ~JunitReporter() CATCH_OVERRIDE; + + static std::string getDescription() { + return "Reports test results in an XML format that looks like Ant's junitreport target"; + } + + virtual void noMatchingTestCases( std::string const& /*spec*/ ) CATCH_OVERRIDE {} + + virtual void testRunStarting( TestRunInfo const& runInfo ) CATCH_OVERRIDE { + CumulativeReporterBase::testRunStarting( runInfo ); + xml.startElement( "testsuites" ); + } + + virtual void testGroupStarting( GroupInfo const& groupInfo ) CATCH_OVERRIDE { + suiteTimer.start(); + stdOutForSuite.str(""); + stdErrForSuite.str(""); + unexpectedExceptions = 0; + CumulativeReporterBase::testGroupStarting( groupInfo ); + } + + virtual void testCaseStarting( TestCaseInfo const& testCaseInfo ) CATCH_OVERRIDE { + m_okToFail = testCaseInfo.okToFail(); + } + virtual bool assertionEnded( AssertionStats const& assertionStats ) CATCH_OVERRIDE { + if( assertionStats.assertionResult.getResultType() == ResultWas::ThrewException && !m_okToFail ) + unexpectedExceptions++; + return CumulativeReporterBase::assertionEnded( assertionStats ); + } + + virtual void testCaseEnded( TestCaseStats const& testCaseStats ) CATCH_OVERRIDE { + stdOutForSuite << testCaseStats.stdOut; + stdErrForSuite << testCaseStats.stdErr; + CumulativeReporterBase::testCaseEnded( testCaseStats ); + } + + virtual void testGroupEnded( TestGroupStats const& testGroupStats ) CATCH_OVERRIDE { + double suiteTime = suiteTimer.getElapsedSeconds(); + CumulativeReporterBase::testGroupEnded( testGroupStats ); + writeGroup( *m_testGroups.back(), suiteTime ); + } + + virtual void testRunEndedCumulative() CATCH_OVERRIDE { + xml.endElement(); + } + + void writeGroup( TestGroupNode const& groupNode, double suiteTime ) { + XmlWriter::ScopedElement e = xml.scopedElement( "testsuite" ); + TestGroupStats const& stats = groupNode.value; + xml.writeAttribute( "name", stats.groupInfo.name ); + xml.writeAttribute( "errors", unexpectedExceptions ); + xml.writeAttribute( "failures", stats.totals.assertions.failed-unexpectedExceptions ); + xml.writeAttribute( "tests", stats.totals.assertions.total() ); + xml.writeAttribute( "hostname", "tbd" ); // !TBD + if( m_config->showDurations() == ShowDurations::Never ) + xml.writeAttribute( "time", "" ); + else + xml.writeAttribute( "time", suiteTime ); + xml.writeAttribute( "timestamp", getCurrentTimestamp() ); + + // Write test cases + for( TestGroupNode::ChildNodes::const_iterator + it = groupNode.children.begin(), itEnd = groupNode.children.end(); + it != itEnd; + ++it ) + writeTestCase( **it ); + + xml.scopedElement( "system-out" ).writeText( trim( stdOutForSuite.str() ), false ); + xml.scopedElement( "system-err" ).writeText( trim( stdErrForSuite.str() ), false ); + } + + void writeTestCase( TestCaseNode const& testCaseNode ) { + TestCaseStats const& stats = testCaseNode.value; + + // All test cases have exactly one section - which represents the + // test case itself. That section may have 0-n nested sections + assert( testCaseNode.children.size() == 1 ); + SectionNode const& rootSection = *testCaseNode.children.front(); + + std::string className = stats.testInfo.className; + + if( className.empty() ) { + if( rootSection.childSections.empty() ) + className = "global"; + } + writeSection( className, "", rootSection ); + } + + void writeSection( std::string const& className, + std::string const& rootName, + SectionNode const& sectionNode ) { + std::string name = trim( sectionNode.stats.sectionInfo.name ); + if( !rootName.empty() ) + name = rootName + '/' + name; + + if( !sectionNode.assertions.empty() || + !sectionNode.stdOut.empty() || + !sectionNode.stdErr.empty() ) { + XmlWriter::ScopedElement e = xml.scopedElement( "testcase" ); + if( className.empty() ) { + xml.writeAttribute( "classname", name ); + xml.writeAttribute( "name", "root" ); + } + else { + xml.writeAttribute( "classname", className ); + xml.writeAttribute( "name", name ); + } + xml.writeAttribute( "time", Catch::toString( sectionNode.stats.durationInSeconds ) ); + + writeAssertions( sectionNode ); + + if( !sectionNode.stdOut.empty() ) + xml.scopedElement( "system-out" ).writeText( trim( sectionNode.stdOut ), false ); + if( !sectionNode.stdErr.empty() ) + xml.scopedElement( "system-err" ).writeText( trim( sectionNode.stdErr ), false ); + } + for( SectionNode::ChildSections::const_iterator + it = sectionNode.childSections.begin(), + itEnd = sectionNode.childSections.end(); + it != itEnd; + ++it ) + if( className.empty() ) + writeSection( name, "", **it ); + else + writeSection( className, name, **it ); + } + + void writeAssertions( SectionNode const& sectionNode ) { + for( SectionNode::Assertions::const_iterator + it = sectionNode.assertions.begin(), itEnd = sectionNode.assertions.end(); + it != itEnd; + ++it ) + writeAssertion( *it ); + } + void writeAssertion( AssertionStats const& stats ) { + AssertionResult const& result = stats.assertionResult; + if( !result.isOk() ) { + std::string elementName; + switch( result.getResultType() ) { + case ResultWas::ThrewException: + case ResultWas::FatalErrorCondition: + elementName = "error"; + break; + case ResultWas::ExplicitFailure: + elementName = "failure"; + break; + case ResultWas::ExpressionFailed: + elementName = "failure"; + break; + case ResultWas::DidntThrowException: + elementName = "failure"; + break; + + // We should never see these here: + case ResultWas::Info: + case ResultWas::Warning: + case ResultWas::Ok: + case ResultWas::Unknown: + case ResultWas::FailureBit: + case ResultWas::Exception: + elementName = "internalError"; + break; + } + + XmlWriter::ScopedElement e = xml.scopedElement( elementName ); + + xml.writeAttribute( "message", result.getExpandedExpression() ); + xml.writeAttribute( "type", result.getTestMacroName() ); + + std::ostringstream oss; + if( !result.getMessage().empty() ) + oss << result.getMessage() << '\n'; + for( std::vector::const_iterator + it = stats.infoMessages.begin(), + itEnd = stats.infoMessages.end(); + it != itEnd; + ++it ) + if( it->type == ResultWas::Info ) + oss << it->message << '\n'; + + oss << "at " << result.getSourceInfo(); + xml.writeText( oss.str(), false ); + } + } + + XmlWriter xml; + Timer suiteTimer; + std::ostringstream stdOutForSuite; + std::ostringstream stdErrForSuite; + unsigned int unexpectedExceptions; + bool m_okToFail; + }; + + INTERNAL_CATCH_REGISTER_REPORTER( "junit", JunitReporter ) + +} // end namespace Catch + +// #included from: ../reporters/catch_reporter_console.hpp +#define TWOBLUECUBES_CATCH_REPORTER_CONSOLE_HPP_INCLUDED + +#include +#include + +namespace Catch { + + struct ConsoleReporter : StreamingReporterBase { + ConsoleReporter( ReporterConfig const& _config ) + : StreamingReporterBase( _config ), + m_headerPrinted( false ) + {} + + virtual ~ConsoleReporter() CATCH_OVERRIDE; + static std::string getDescription() { + return "Reports test results as plain lines of text"; + } + + virtual void noMatchingTestCases( std::string const& spec ) CATCH_OVERRIDE { + stream << "No test cases matched '" << spec << '\'' << std::endl; + } + + virtual void assertionStarting( AssertionInfo const& ) CATCH_OVERRIDE { + } + + virtual bool assertionEnded( AssertionStats const& _assertionStats ) CATCH_OVERRIDE { + AssertionResult const& result = _assertionStats.assertionResult; + + bool includeResults = m_config->includeSuccessfulResults() || !result.isOk(); + + // Drop out if result was successful but we're not printing them. + if( !includeResults && result.getResultType() != ResultWas::Warning ) + return false; + + lazyPrint(); + + AssertionPrinter printer( stream, _assertionStats, includeResults ); + printer.print(); + stream << std::endl; + return true; + } + + virtual void sectionStarting( SectionInfo const& _sectionInfo ) CATCH_OVERRIDE { + m_headerPrinted = false; + StreamingReporterBase::sectionStarting( _sectionInfo ); + } + virtual void sectionEnded( SectionStats const& _sectionStats ) CATCH_OVERRIDE { + if( _sectionStats.missingAssertions ) { + lazyPrint(); + Colour colour( Colour::ResultError ); + if( m_sectionStack.size() > 1 ) + stream << "\nNo assertions in section"; + else + stream << "\nNo assertions in test case"; + stream << " '" << _sectionStats.sectionInfo.name << "'\n" << std::endl; + } + if( m_config->showDurations() == ShowDurations::Always ) { + stream << getFormattedDuration(_sectionStats.durationInSeconds) << " s: " << _sectionStats.sectionInfo.name << std::endl; + } + if( m_headerPrinted ) { + m_headerPrinted = false; + } + StreamingReporterBase::sectionEnded( _sectionStats ); + } + + virtual void testCaseEnded( TestCaseStats const& _testCaseStats ) CATCH_OVERRIDE { + StreamingReporterBase::testCaseEnded( _testCaseStats ); + m_headerPrinted = false; + } + virtual void testGroupEnded( TestGroupStats const& _testGroupStats ) CATCH_OVERRIDE { + if( currentGroupInfo.used ) { + printSummaryDivider(); + stream << "Summary for group '" << _testGroupStats.groupInfo.name << "':\n"; + printTotals( _testGroupStats.totals ); + stream << '\n' << std::endl; + } + StreamingReporterBase::testGroupEnded( _testGroupStats ); + } + virtual void testRunEnded( TestRunStats const& _testRunStats ) CATCH_OVERRIDE { + printTotalsDivider( _testRunStats.totals ); + printTotals( _testRunStats.totals ); + stream << std::endl; + StreamingReporterBase::testRunEnded( _testRunStats ); + } + + private: + + class AssertionPrinter { + void operator= ( AssertionPrinter const& ); + public: + AssertionPrinter( std::ostream& _stream, AssertionStats const& _stats, bool _printInfoMessages ) + : stream( _stream ), + stats( _stats ), + result( _stats.assertionResult ), + colour( Colour::None ), + message( result.getMessage() ), + messages( _stats.infoMessages ), + printInfoMessages( _printInfoMessages ) + { + switch( result.getResultType() ) { + case ResultWas::Ok: + colour = Colour::Success; + passOrFail = "PASSED"; + //if( result.hasMessage() ) + if( _stats.infoMessages.size() == 1 ) + messageLabel = "with message"; + if( _stats.infoMessages.size() > 1 ) + messageLabel = "with messages"; + break; + case ResultWas::ExpressionFailed: + if( result.isOk() ) { + colour = Colour::Success; + passOrFail = "FAILED - but was ok"; + } + else { + colour = Colour::Error; + passOrFail = "FAILED"; + } + if( _stats.infoMessages.size() == 1 ) + messageLabel = "with message"; + if( _stats.infoMessages.size() > 1 ) + messageLabel = "with messages"; + break; + case ResultWas::ThrewException: + colour = Colour::Error; + passOrFail = "FAILED"; + messageLabel = "due to unexpected exception with "; + if (_stats.infoMessages.size() == 1) + messageLabel += "message"; + if (_stats.infoMessages.size() > 1) + messageLabel += "messages"; + break; + case ResultWas::FatalErrorCondition: + colour = Colour::Error; + passOrFail = "FAILED"; + messageLabel = "due to a fatal error condition"; + break; + case ResultWas::DidntThrowException: + colour = Colour::Error; + passOrFail = "FAILED"; + messageLabel = "because no exception was thrown where one was expected"; + break; + case ResultWas::Info: + messageLabel = "info"; + break; + case ResultWas::Warning: + messageLabel = "warning"; + break; + case ResultWas::ExplicitFailure: + passOrFail = "FAILED"; + colour = Colour::Error; + if( _stats.infoMessages.size() == 1 ) + messageLabel = "explicitly with message"; + if( _stats.infoMessages.size() > 1 ) + messageLabel = "explicitly with messages"; + break; + // These cases are here to prevent compiler warnings + case ResultWas::Unknown: + case ResultWas::FailureBit: + case ResultWas::Exception: + passOrFail = "** internal error **"; + colour = Colour::Error; + break; + } + } + + void print() const { + printSourceInfo(); + if( stats.totals.assertions.total() > 0 ) { + if( result.isOk() ) + stream << '\n'; + printResultType(); + printOriginalExpression(); + printReconstructedExpression(); + } + else { + stream << '\n'; + } + printMessage(); + } + + private: + void printResultType() const { + if( !passOrFail.empty() ) { + Colour colourGuard( colour ); + stream << passOrFail << ":\n"; + } + } + void printOriginalExpression() const { + if( result.hasExpression() ) { + Colour colourGuard( Colour::OriginalExpression ); + stream << " "; + stream << result.getExpressionInMacro(); + stream << '\n'; + } + } + void printReconstructedExpression() const { + if( result.hasExpandedExpression() ) { + stream << "with expansion:\n"; + Colour colourGuard( Colour::ReconstructedExpression ); + stream << Text( result.getExpandedExpression(), TextAttributes().setIndent(2) ) << '\n'; + } + } + void printMessage() const { + if( !messageLabel.empty() ) + stream << messageLabel << ':' << '\n'; + for( std::vector::const_iterator it = messages.begin(), itEnd = messages.end(); + it != itEnd; + ++it ) { + // If this assertion is a warning ignore any INFO messages + if( printInfoMessages || it->type != ResultWas::Info ) + stream << Text( it->message, TextAttributes().setIndent(2) ) << '\n'; + } + } + void printSourceInfo() const { + Colour colourGuard( Colour::FileName ); + stream << result.getSourceInfo() << ": "; + } + + std::ostream& stream; + AssertionStats const& stats; + AssertionResult const& result; + Colour::Code colour; + std::string passOrFail; + std::string messageLabel; + std::string message; + std::vector messages; + bool printInfoMessages; + }; + + void lazyPrint() { + + if( !currentTestRunInfo.used ) + lazyPrintRunInfo(); + if( !currentGroupInfo.used ) + lazyPrintGroupInfo(); + + if( !m_headerPrinted ) { + printTestCaseAndSectionHeader(); + m_headerPrinted = true; + } + } + void lazyPrintRunInfo() { + stream << '\n' << getLineOfChars<'~'>() << '\n'; + Colour colour( Colour::SecondaryText ); + stream << currentTestRunInfo->name + << " is a Catch v" << libraryVersion() << " host application.\n" + << "Run with -? for options\n\n"; + + if( m_config->rngSeed() != 0 ) + stream << "Randomness seeded to: " << m_config->rngSeed() << "\n\n"; + + currentTestRunInfo.used = true; + } + void lazyPrintGroupInfo() { + if( !currentGroupInfo->name.empty() && currentGroupInfo->groupsCounts > 1 ) { + printClosedHeader( "Group: " + currentGroupInfo->name ); + currentGroupInfo.used = true; + } + } + void printTestCaseAndSectionHeader() { + assert( !m_sectionStack.empty() ); + printOpenHeader( currentTestCaseInfo->name ); + + if( m_sectionStack.size() > 1 ) { + Colour colourGuard( Colour::Headers ); + + std::vector::const_iterator + it = m_sectionStack.begin()+1, // Skip first section (test case) + itEnd = m_sectionStack.end(); + for( ; it != itEnd; ++it ) + printHeaderString( it->name, 2 ); + } + + SourceLineInfo lineInfo = m_sectionStack.back().lineInfo; + + if( !lineInfo.empty() ){ + stream << getLineOfChars<'-'>() << '\n'; + Colour colourGuard( Colour::FileName ); + stream << lineInfo << '\n'; + } + stream << getLineOfChars<'.'>() << '\n' << std::endl; + } + + void printClosedHeader( std::string const& _name ) { + printOpenHeader( _name ); + stream << getLineOfChars<'.'>() << '\n'; + } + void printOpenHeader( std::string const& _name ) { + stream << getLineOfChars<'-'>() << '\n'; + { + Colour colourGuard( Colour::Headers ); + printHeaderString( _name ); + } + } + + // if string has a : in first line will set indent to follow it on + // subsequent lines + void printHeaderString( std::string const& _string, std::size_t indent = 0 ) { + std::size_t i = _string.find( ": " ); + if( i != std::string::npos ) + i+=2; + else + i = 0; + stream << Text( _string, TextAttributes() + .setIndent( indent+i) + .setInitialIndent( indent ) ) << '\n'; + } + + struct SummaryColumn { + + SummaryColumn( std::string const& _label, Colour::Code _colour ) + : label( _label ), + colour( _colour ) + {} + SummaryColumn addRow( std::size_t count ) { + std::ostringstream oss; + oss << count; + std::string row = oss.str(); + for( std::vector::iterator it = rows.begin(); it != rows.end(); ++it ) { + while( it->size() < row.size() ) + *it = ' ' + *it; + while( it->size() > row.size() ) + row = ' ' + row; + } + rows.push_back( row ); + return *this; + } + + std::string label; + Colour::Code colour; + std::vector rows; + + }; + + void printTotals( Totals const& totals ) { + if( totals.testCases.total() == 0 ) { + stream << Colour( Colour::Warning ) << "No tests ran\n"; + } + else if( totals.assertions.total() > 0 && totals.testCases.allPassed() ) { + stream << Colour( Colour::ResultSuccess ) << "All tests passed"; + stream << " (" + << pluralise( totals.assertions.passed, "assertion" ) << " in " + << pluralise( totals.testCases.passed, "test case" ) << ')' + << '\n'; + } + else { + + std::vector columns; + columns.push_back( SummaryColumn( "", Colour::None ) + .addRow( totals.testCases.total() ) + .addRow( totals.assertions.total() ) ); + columns.push_back( SummaryColumn( "passed", Colour::Success ) + .addRow( totals.testCases.passed ) + .addRow( totals.assertions.passed ) ); + columns.push_back( SummaryColumn( "failed", Colour::ResultError ) + .addRow( totals.testCases.failed ) + .addRow( totals.assertions.failed ) ); + columns.push_back( SummaryColumn( "failed as expected", Colour::ResultExpectedFailure ) + .addRow( totals.testCases.failedButOk ) + .addRow( totals.assertions.failedButOk ) ); + + printSummaryRow( "test cases", columns, 0 ); + printSummaryRow( "assertions", columns, 1 ); + } + } + void printSummaryRow( std::string const& label, std::vector const& cols, std::size_t row ) { + for( std::vector::const_iterator it = cols.begin(); it != cols.end(); ++it ) { + std::string value = it->rows[row]; + if( it->label.empty() ) { + stream << label << ": "; + if( value != "0" ) + stream << value; + else + stream << Colour( Colour::Warning ) << "- none -"; + } + else if( value != "0" ) { + stream << Colour( Colour::LightGrey ) << " | "; + stream << Colour( it->colour ) + << value << ' ' << it->label; + } + } + stream << '\n'; + } + + static std::size_t makeRatio( std::size_t number, std::size_t total ) { + std::size_t ratio = total > 0 ? CATCH_CONFIG_CONSOLE_WIDTH * number/ total : 0; + return ( ratio == 0 && number > 0 ) ? 1 : ratio; + } + static std::size_t& findMax( std::size_t& i, std::size_t& j, std::size_t& k ) { + if( i > j && i > k ) + return i; + else if( j > k ) + return j; + else + return k; + } + + void printTotalsDivider( Totals const& totals ) { + if( totals.testCases.total() > 0 ) { + std::size_t failedRatio = makeRatio( totals.testCases.failed, totals.testCases.total() ); + std::size_t failedButOkRatio = makeRatio( totals.testCases.failedButOk, totals.testCases.total() ); + std::size_t passedRatio = makeRatio( totals.testCases.passed, totals.testCases.total() ); + while( failedRatio + failedButOkRatio + passedRatio < CATCH_CONFIG_CONSOLE_WIDTH-1 ) + findMax( failedRatio, failedButOkRatio, passedRatio )++; + while( failedRatio + failedButOkRatio + passedRatio > CATCH_CONFIG_CONSOLE_WIDTH-1 ) + findMax( failedRatio, failedButOkRatio, passedRatio )--; + + stream << Colour( Colour::Error ) << std::string( failedRatio, '=' ); + stream << Colour( Colour::ResultExpectedFailure ) << std::string( failedButOkRatio, '=' ); + if( totals.testCases.allPassed() ) + stream << Colour( Colour::ResultSuccess ) << std::string( passedRatio, '=' ); + else + stream << Colour( Colour::Success ) << std::string( passedRatio, '=' ); + } + else { + stream << Colour( Colour::Warning ) << std::string( CATCH_CONFIG_CONSOLE_WIDTH-1, '=' ); + } + stream << '\n'; + } + void printSummaryDivider() { + stream << getLineOfChars<'-'>() << '\n'; + } + + private: + bool m_headerPrinted; + }; + + INTERNAL_CATCH_REGISTER_REPORTER( "console", ConsoleReporter ) + +} // end namespace Catch + +// #included from: ../reporters/catch_reporter_compact.hpp +#define TWOBLUECUBES_CATCH_REPORTER_COMPACT_HPP_INCLUDED + +namespace Catch { + + struct CompactReporter : StreamingReporterBase { + + CompactReporter( ReporterConfig const& _config ) + : StreamingReporterBase( _config ) + {} + + virtual ~CompactReporter(); + + static std::string getDescription() { + return "Reports test results on a single line, suitable for IDEs"; + } + + virtual ReporterPreferences getPreferences() const { + ReporterPreferences prefs; + prefs.shouldRedirectStdOut = false; + return prefs; + } + + virtual void noMatchingTestCases( std::string const& spec ) { + stream << "No test cases matched '" << spec << '\'' << std::endl; + } + + virtual void assertionStarting( AssertionInfo const& ) {} + + virtual bool assertionEnded( AssertionStats const& _assertionStats ) { + AssertionResult const& result = _assertionStats.assertionResult; + + bool printInfoMessages = true; + + // Drop out if result was successful and we're not printing those + if( !m_config->includeSuccessfulResults() && result.isOk() ) { + if( result.getResultType() != ResultWas::Warning ) + return false; + printInfoMessages = false; + } + + AssertionPrinter printer( stream, _assertionStats, printInfoMessages ); + printer.print(); + + stream << std::endl; + return true; + } + + virtual void sectionEnded(SectionStats const& _sectionStats) CATCH_OVERRIDE { + if (m_config->showDurations() == ShowDurations::Always) { + stream << getFormattedDuration(_sectionStats.durationInSeconds) << " s: " << _sectionStats.sectionInfo.name << std::endl; + } + } + + virtual void testRunEnded( TestRunStats const& _testRunStats ) { + printTotals( _testRunStats.totals ); + stream << '\n' << std::endl; + StreamingReporterBase::testRunEnded( _testRunStats ); + } + + private: + class AssertionPrinter { + void operator= ( AssertionPrinter const& ); + public: + AssertionPrinter( std::ostream& _stream, AssertionStats const& _stats, bool _printInfoMessages ) + : stream( _stream ) + , stats( _stats ) + , result( _stats.assertionResult ) + , messages( _stats.infoMessages ) + , itMessage( _stats.infoMessages.begin() ) + , printInfoMessages( _printInfoMessages ) + {} + + void print() { + printSourceInfo(); + + itMessage = messages.begin(); + + switch( result.getResultType() ) { + case ResultWas::Ok: + printResultType( Colour::ResultSuccess, passedString() ); + printOriginalExpression(); + printReconstructedExpression(); + if ( ! result.hasExpression() ) + printRemainingMessages( Colour::None ); + else + printRemainingMessages(); + break; + case ResultWas::ExpressionFailed: + if( result.isOk() ) + printResultType( Colour::ResultSuccess, failedString() + std::string( " - but was ok" ) ); + else + printResultType( Colour::Error, failedString() ); + printOriginalExpression(); + printReconstructedExpression(); + printRemainingMessages(); + break; + case ResultWas::ThrewException: + printResultType( Colour::Error, failedString() ); + printIssue( "unexpected exception with message:" ); + printMessage(); + printExpressionWas(); + printRemainingMessages(); + break; + case ResultWas::FatalErrorCondition: + printResultType( Colour::Error, failedString() ); + printIssue( "fatal error condition with message:" ); + printMessage(); + printExpressionWas(); + printRemainingMessages(); + break; + case ResultWas::DidntThrowException: + printResultType( Colour::Error, failedString() ); + printIssue( "expected exception, got none" ); + printExpressionWas(); + printRemainingMessages(); + break; + case ResultWas::Info: + printResultType( Colour::None, "info" ); + printMessage(); + printRemainingMessages(); + break; + case ResultWas::Warning: + printResultType( Colour::None, "warning" ); + printMessage(); + printRemainingMessages(); + break; + case ResultWas::ExplicitFailure: + printResultType( Colour::Error, failedString() ); + printIssue( "explicitly" ); + printRemainingMessages( Colour::None ); + break; + // These cases are here to prevent compiler warnings + case ResultWas::Unknown: + case ResultWas::FailureBit: + case ResultWas::Exception: + printResultType( Colour::Error, "** internal error **" ); + break; + } + } + + private: + // Colour::LightGrey + + static Colour::Code dimColour() { return Colour::FileName; } + +#ifdef CATCH_PLATFORM_MAC + static const char* failedString() { return "FAILED"; } + static const char* passedString() { return "PASSED"; } +#else + static const char* failedString() { return "failed"; } + static const char* passedString() { return "passed"; } +#endif + + void printSourceInfo() const { + Colour colourGuard( Colour::FileName ); + stream << result.getSourceInfo() << ':'; + } + + void printResultType( Colour::Code colour, std::string const& passOrFail ) const { + if( !passOrFail.empty() ) { + { + Colour colourGuard( colour ); + stream << ' ' << passOrFail; + } + stream << ':'; + } + } + + void printIssue( std::string const& issue ) const { + stream << ' ' << issue; + } + + void printExpressionWas() { + if( result.hasExpression() ) { + stream << ';'; + { + Colour colour( dimColour() ); + stream << " expression was:"; + } + printOriginalExpression(); + } + } + + void printOriginalExpression() const { + if( result.hasExpression() ) { + stream << ' ' << result.getExpression(); + } + } + + void printReconstructedExpression() const { + if( result.hasExpandedExpression() ) { + { + Colour colour( dimColour() ); + stream << " for: "; + } + stream << result.getExpandedExpression(); + } + } + + void printMessage() { + if ( itMessage != messages.end() ) { + stream << " '" << itMessage->message << '\''; + ++itMessage; + } + } + + void printRemainingMessages( Colour::Code colour = dimColour() ) { + if ( itMessage == messages.end() ) + return; + + // using messages.end() directly yields compilation error: + std::vector::const_iterator itEnd = messages.end(); + const std::size_t N = static_cast( std::distance( itMessage, itEnd ) ); + + { + Colour colourGuard( colour ); + stream << " with " << pluralise( N, "message" ) << ':'; + } + + for(; itMessage != itEnd; ) { + // If this assertion is a warning ignore any INFO messages + if( printInfoMessages || itMessage->type != ResultWas::Info ) { + stream << " '" << itMessage->message << '\''; + if ( ++itMessage != itEnd ) { + Colour colourGuard( dimColour() ); + stream << " and"; + } + } + } + } + + private: + std::ostream& stream; + AssertionStats const& stats; + AssertionResult const& result; + std::vector messages; + std::vector::const_iterator itMessage; + bool printInfoMessages; + }; + + // Colour, message variants: + // - white: No tests ran. + // - red: Failed [both/all] N test cases, failed [both/all] M assertions. + // - white: Passed [both/all] N test cases (no assertions). + // - red: Failed N tests cases, failed M assertions. + // - green: Passed [both/all] N tests cases with M assertions. + + std::string bothOrAll( std::size_t count ) const { + return count == 1 ? std::string() : count == 2 ? "both " : "all " ; + } + + void printTotals( const Totals& totals ) const { + if( totals.testCases.total() == 0 ) { + stream << "No tests ran."; + } + else if( totals.testCases.failed == totals.testCases.total() ) { + Colour colour( Colour::ResultError ); + const std::string qualify_assertions_failed = + totals.assertions.failed == totals.assertions.total() ? + bothOrAll( totals.assertions.failed ) : std::string(); + stream << + "Failed " << bothOrAll( totals.testCases.failed ) + << pluralise( totals.testCases.failed, "test case" ) << ", " + "failed " << qualify_assertions_failed << + pluralise( totals.assertions.failed, "assertion" ) << '.'; + } + else if( totals.assertions.total() == 0 ) { + stream << + "Passed " << bothOrAll( totals.testCases.total() ) + << pluralise( totals.testCases.total(), "test case" ) + << " (no assertions)."; + } + else if( totals.assertions.failed ) { + Colour colour( Colour::ResultError ); + stream << + "Failed " << pluralise( totals.testCases.failed, "test case" ) << ", " + "failed " << pluralise( totals.assertions.failed, "assertion" ) << '.'; + } + else { + Colour colour( Colour::ResultSuccess ); + stream << + "Passed " << bothOrAll( totals.testCases.passed ) + << pluralise( totals.testCases.passed, "test case" ) << + " with " << pluralise( totals.assertions.passed, "assertion" ) << '.'; + } + } + }; + + INTERNAL_CATCH_REGISTER_REPORTER( "compact", CompactReporter ) + +} // end namespace Catch + +namespace Catch { + // These are all here to avoid warnings about not having any out of line + // virtual methods + NonCopyable::~NonCopyable() {} + IShared::~IShared() {} + IStream::~IStream() CATCH_NOEXCEPT {} + FileStream::~FileStream() CATCH_NOEXCEPT {} + CoutStream::~CoutStream() CATCH_NOEXCEPT {} + DebugOutStream::~DebugOutStream() CATCH_NOEXCEPT {} + StreamBufBase::~StreamBufBase() CATCH_NOEXCEPT {} + IContext::~IContext() {} + IResultCapture::~IResultCapture() {} + ITestCase::~ITestCase() {} + ITestCaseRegistry::~ITestCaseRegistry() {} + IRegistryHub::~IRegistryHub() {} + IMutableRegistryHub::~IMutableRegistryHub() {} + IExceptionTranslator::~IExceptionTranslator() {} + IExceptionTranslatorRegistry::~IExceptionTranslatorRegistry() {} + IReporter::~IReporter() {} + IReporterFactory::~IReporterFactory() {} + IReporterRegistry::~IReporterRegistry() {} + IStreamingReporter::~IStreamingReporter() {} + AssertionStats::~AssertionStats() {} + SectionStats::~SectionStats() {} + TestCaseStats::~TestCaseStats() {} + TestGroupStats::~TestGroupStats() {} + TestRunStats::~TestRunStats() {} + CumulativeReporterBase::SectionNode::~SectionNode() {} + CumulativeReporterBase::~CumulativeReporterBase() {} + + StreamingReporterBase::~StreamingReporterBase() {} + ConsoleReporter::~ConsoleReporter() {} + CompactReporter::~CompactReporter() {} + IRunner::~IRunner() {} + IMutableContext::~IMutableContext() {} + IConfig::~IConfig() {} + XmlReporter::~XmlReporter() {} + JunitReporter::~JunitReporter() {} + TestRegistry::~TestRegistry() {} + FreeFunctionTestCase::~FreeFunctionTestCase() {} + IGeneratorInfo::~IGeneratorInfo() {} + IGeneratorsForTest::~IGeneratorsForTest() {} + WildcardPattern::~WildcardPattern() {} + TestSpec::Pattern::~Pattern() {} + TestSpec::NamePattern::~NamePattern() {} + TestSpec::TagPattern::~TagPattern() {} + TestSpec::ExcludedPattern::~ExcludedPattern() {} + Matchers::Impl::MatcherUntypedBase::~MatcherUntypedBase() {} + + void Config::dummy() {} + + namespace TestCaseTracking { + ITracker::~ITracker() {} + TrackerBase::~TrackerBase() {} + SectionTracker::~SectionTracker() {} + IndexTracker::~IndexTracker() {} + } +} + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + +#endif + +#ifdef CATCH_CONFIG_MAIN +// #included from: internal/catch_default_main.hpp +#define TWOBLUECUBES_CATCH_DEFAULT_MAIN_HPP_INCLUDED + +#ifndef __OBJC__ + +#if defined(WIN32) && defined(_UNICODE) && !defined(DO_NOT_USE_WMAIN) +// Standard C/C++ Win32 Unicode wmain entry point +extern "C" int wmain (int argc, wchar_t * argv[], wchar_t * []) { +#else +// Standard C/C++ main entry point +int main (int argc, char * argv[]) { +#endif + + int result = Catch::Session().run( argc, argv ); + return ( result < 0xff ? result : 0xff ); +} + +#else // __OBJC__ + +// Objective-C entry point +int main (int argc, char * const argv[]) { +#if !CATCH_ARC_ENABLED + NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; +#endif + + Catch::registerTestMethods(); + int result = Catch::Session().run( argc, (char* const*)argv ); + +#if !CATCH_ARC_ENABLED + [pool drain]; +#endif + + return ( result < 0xff ? result : 0xff ); +} + +#endif // __OBJC__ + +#endif + +#ifdef CLARA_CONFIG_MAIN_NOT_DEFINED +# undef CLARA_CONFIG_MAIN +#endif + +////// + +// If this config identifier is defined then all CATCH macros are prefixed with CATCH_ +#ifdef CATCH_CONFIG_PREFIX_ALL + +#if defined(CATCH_CONFIG_FAST_COMPILE) +#define CATCH_REQUIRE( expr ) INTERNAL_CATCH_TEST_NO_TRY( "CATCH_REQUIRE", Catch::ResultDisposition::Normal, expr ) +#define CATCH_REQUIRE_FALSE( expr ) INTERNAL_CATCH_TEST_NO_TRY( "CATCH_REQUIRE_FALSE", Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, expr ) +#else +#define CATCH_REQUIRE( expr ) INTERNAL_CATCH_TEST( "CATCH_REQUIRE", Catch::ResultDisposition::Normal, expr ) +#define CATCH_REQUIRE_FALSE( expr ) INTERNAL_CATCH_TEST( "CATCH_REQUIRE_FALSE", Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, expr ) +#endif + +#define CATCH_REQUIRE_THROWS( expr ) INTERNAL_CATCH_THROWS( "CATCH_REQUIRE_THROWS", Catch::ResultDisposition::Normal, "", expr ) +#define CATCH_REQUIRE_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( "CATCH_REQUIRE_THROWS_AS", exceptionType, Catch::ResultDisposition::Normal, expr ) +#define CATCH_REQUIRE_THROWS_WITH( expr, matcher ) INTERNAL_CATCH_THROWS( "CATCH_REQUIRE_THROWS_WITH", Catch::ResultDisposition::Normal, matcher, expr ) +#define CATCH_REQUIRE_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( "CATCH_REQUIRE_NOTHROW", Catch::ResultDisposition::Normal, expr ) + +#define CATCH_CHECK( expr ) INTERNAL_CATCH_TEST( "CATCH_CHECK", Catch::ResultDisposition::ContinueOnFailure, expr ) +#define CATCH_CHECK_FALSE( expr ) INTERNAL_CATCH_TEST( "CATCH_CHECK_FALSE", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::FalseTest, expr ) +#define CATCH_CHECKED_IF( expr ) INTERNAL_CATCH_IF( "CATCH_CHECKED_IF", Catch::ResultDisposition::ContinueOnFailure, expr ) +#define CATCH_CHECKED_ELSE( expr ) INTERNAL_CATCH_ELSE( "CATCH_CHECKED_ELSE", Catch::ResultDisposition::ContinueOnFailure, expr ) +#define CATCH_CHECK_NOFAIL( expr ) INTERNAL_CATCH_TEST( "CATCH_CHECK_NOFAIL", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, expr ) + +#define CATCH_CHECK_THROWS( expr ) INTERNAL_CATCH_THROWS( "CATCH_CHECK_THROWS", Catch::ResultDisposition::ContinueOnFailure, "", expr ) +#define CATCH_CHECK_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( "CATCH_CHECK_THROWS_AS", exceptionType, Catch::ResultDisposition::ContinueOnFailure, expr ) +#define CATCH_CHECK_THROWS_WITH( expr, matcher ) INTERNAL_CATCH_THROWS( "CATCH_CHECK_THROWS_WITH", Catch::ResultDisposition::ContinueOnFailure, matcher, expr ) +#define CATCH_CHECK_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( "CATCH_CHECK_NOTHROW", Catch::ResultDisposition::ContinueOnFailure, expr ) + +#define CATCH_CHECK_THAT( arg, matcher ) INTERNAL_CHECK_THAT( "CATCH_CHECK_THAT", matcher, Catch::ResultDisposition::ContinueOnFailure, arg ) + +#if defined(CATCH_CONFIG_FAST_COMPILE) +#define CATCH_REQUIRE_THAT( arg, matcher ) INTERNAL_CHECK_THAT_NO_TRY( "CATCH_REQUIRE_THAT", matcher, Catch::ResultDisposition::Normal, arg ) +#else +#define CATCH_REQUIRE_THAT( arg, matcher ) INTERNAL_CHECK_THAT( "CATCH_REQUIRE_THAT", matcher, Catch::ResultDisposition::Normal, arg ) +#endif + +#define CATCH_INFO( msg ) INTERNAL_CATCH_INFO( "CATCH_INFO", msg ) +#define CATCH_WARN( msg ) INTERNAL_CATCH_MSG( "CATCH_WARN", Catch::ResultWas::Warning, Catch::ResultDisposition::ContinueOnFailure, msg ) +#define CATCH_SCOPED_INFO( msg ) INTERNAL_CATCH_INFO( "CATCH_INFO", msg ) +#define CATCH_CAPTURE( msg ) INTERNAL_CATCH_INFO( "CATCH_CAPTURE", #msg " := " << Catch::toString(msg) ) +#define CATCH_SCOPED_CAPTURE( msg ) INTERNAL_CATCH_INFO( "CATCH_CAPTURE", #msg " := " << Catch::toString(msg) ) + +#ifdef CATCH_CONFIG_VARIADIC_MACROS + #define CATCH_TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE( __VA_ARGS__ ) + #define CATCH_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, __VA_ARGS__ ) + #define CATCH_METHOD_AS_TEST_CASE( method, ... ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, __VA_ARGS__ ) + #define CATCH_REGISTER_TEST_CASE( Function, ... ) INTERNAL_CATCH_REGISTER_TESTCASE( Function, __VA_ARGS__ ) + #define CATCH_SECTION( ... ) INTERNAL_CATCH_SECTION( __VA_ARGS__ ) + #define CATCH_FAIL( ... ) INTERNAL_CATCH_MSG( "CATCH_FAIL", Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, __VA_ARGS__ ) + #define CATCH_FAIL_CHECK( ... ) INTERNAL_CATCH_MSG( "CATCH_FAIL_CHECK", Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ ) + #define CATCH_SUCCEED( ... ) INTERNAL_CATCH_MSG( "CATCH_SUCCEED", Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ ) +#else + #define CATCH_TEST_CASE( name, description ) INTERNAL_CATCH_TESTCASE( name, description ) + #define CATCH_TEST_CASE_METHOD( className, name, description ) INTERNAL_CATCH_TEST_CASE_METHOD( className, name, description ) + #define CATCH_METHOD_AS_TEST_CASE( method, name, description ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, name, description ) + #define CATCH_REGISTER_TEST_CASE( function, name, description ) INTERNAL_CATCH_REGISTER_TESTCASE( function, name, description ) + #define CATCH_SECTION( name, description ) INTERNAL_CATCH_SECTION( name, description ) + #define CATCH_FAIL( msg ) INTERNAL_CATCH_MSG( "CATCH_FAIL", Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, msg ) + #define CATCH_FAIL_CHECK( msg ) INTERNAL_CATCH_MSG( "CATCH_FAIL_CHECK", Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::ContinueOnFailure, msg ) + #define CATCH_SUCCEED( msg ) INTERNAL_CATCH_MSG( "CATCH_SUCCEED", Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, msg ) +#endif +#define CATCH_ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE( "", "" ) + +#define CATCH_REGISTER_REPORTER( name, reporterType ) INTERNAL_CATCH_REGISTER_REPORTER( name, reporterType ) +#define CATCH_REGISTER_LEGACY_REPORTER( name, reporterType ) INTERNAL_CATCH_REGISTER_LEGACY_REPORTER( name, reporterType ) + +#define CATCH_GENERATE( expr) INTERNAL_CATCH_GENERATE( expr ) + +// "BDD-style" convenience wrappers +#ifdef CATCH_CONFIG_VARIADIC_MACROS +#define CATCH_SCENARIO( ... ) CATCH_TEST_CASE( "Scenario: " __VA_ARGS__ ) +#define CATCH_SCENARIO_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, "Scenario: " __VA_ARGS__ ) +#else +#define CATCH_SCENARIO( name, tags ) CATCH_TEST_CASE( "Scenario: " name, tags ) +#define CATCH_SCENARIO_METHOD( className, name, tags ) INTERNAL_CATCH_TEST_CASE_METHOD( className, "Scenario: " name, tags ) +#endif +#define CATCH_GIVEN( desc ) CATCH_SECTION( std::string( "Given: ") + desc, "" ) +#define CATCH_WHEN( desc ) CATCH_SECTION( std::string( " When: ") + desc, "" ) +#define CATCH_AND_WHEN( desc ) CATCH_SECTION( std::string( " And: ") + desc, "" ) +#define CATCH_THEN( desc ) CATCH_SECTION( std::string( " Then: ") + desc, "" ) +#define CATCH_AND_THEN( desc ) CATCH_SECTION( std::string( " And: ") + desc, "" ) + +// If CATCH_CONFIG_PREFIX_ALL is not defined then the CATCH_ prefix is not required +#else + +#if defined(CATCH_CONFIG_FAST_COMPILE) +#define REQUIRE( expr ) INTERNAL_CATCH_TEST_NO_TRY( "REQUIRE", Catch::ResultDisposition::Normal, expr ) +#define REQUIRE_FALSE( expr ) INTERNAL_CATCH_TEST_NO_TRY( "REQUIRE_FALSE", Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, expr ) + +#else +#define REQUIRE( expr ) INTERNAL_CATCH_TEST( "REQUIRE", Catch::ResultDisposition::Normal, expr ) +#define REQUIRE_FALSE( expr ) INTERNAL_CATCH_TEST( "REQUIRE_FALSE", Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, expr ) +#endif + +#define REQUIRE_THROWS( expr ) INTERNAL_CATCH_THROWS( "REQUIRE_THROWS", Catch::ResultDisposition::Normal, "", expr ) +#define REQUIRE_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( "REQUIRE_THROWS_AS", exceptionType, Catch::ResultDisposition::Normal, expr ) +#define REQUIRE_THROWS_WITH( expr, matcher ) INTERNAL_CATCH_THROWS( "REQUIRE_THROWS_WITH", Catch::ResultDisposition::Normal, matcher, expr ) +#define REQUIRE_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( "REQUIRE_NOTHROW", Catch::ResultDisposition::Normal, expr ) + +#define CHECK( expr ) INTERNAL_CATCH_TEST( "CHECK", Catch::ResultDisposition::ContinueOnFailure, expr ) +#define CHECK_FALSE( expr ) INTERNAL_CATCH_TEST( "CHECK_FALSE", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::FalseTest, expr ) +#define CHECKED_IF( expr ) INTERNAL_CATCH_IF( "CHECKED_IF", Catch::ResultDisposition::ContinueOnFailure, expr ) +#define CHECKED_ELSE( expr ) INTERNAL_CATCH_ELSE( "CHECKED_ELSE", Catch::ResultDisposition::ContinueOnFailure, expr ) +#define CHECK_NOFAIL( expr ) INTERNAL_CATCH_TEST( "CHECK_NOFAIL", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, expr ) + +#define CHECK_THROWS( expr ) INTERNAL_CATCH_THROWS( "CHECK_THROWS", Catch::ResultDisposition::ContinueOnFailure, "", expr ) +#define CHECK_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( "CHECK_THROWS_AS", exceptionType, Catch::ResultDisposition::ContinueOnFailure, expr ) +#define CHECK_THROWS_WITH( expr, matcher ) INTERNAL_CATCH_THROWS( "CHECK_THROWS_WITH", Catch::ResultDisposition::ContinueOnFailure, matcher, expr ) +#define CHECK_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( "CHECK_NOTHROW", Catch::ResultDisposition::ContinueOnFailure, expr ) + +#define CHECK_THAT( arg, matcher ) INTERNAL_CHECK_THAT( "CHECK_THAT", matcher, Catch::ResultDisposition::ContinueOnFailure, arg ) + +#if defined(CATCH_CONFIG_FAST_COMPILE) +#define REQUIRE_THAT( arg, matcher ) INTERNAL_CHECK_THAT_NO_TRY( "REQUIRE_THAT", matcher, Catch::ResultDisposition::Normal, arg ) +#else +#define REQUIRE_THAT( arg, matcher ) INTERNAL_CHECK_THAT( "REQUIRE_THAT", matcher, Catch::ResultDisposition::Normal, arg ) +#endif + +#define INFO( msg ) INTERNAL_CATCH_INFO( "INFO", msg ) +#define WARN( msg ) INTERNAL_CATCH_MSG( "WARN", Catch::ResultWas::Warning, Catch::ResultDisposition::ContinueOnFailure, msg ) +#define SCOPED_INFO( msg ) INTERNAL_CATCH_INFO( "INFO", msg ) +#define CAPTURE( msg ) INTERNAL_CATCH_INFO( "CAPTURE", #msg " := " << Catch::toString(msg) ) +#define SCOPED_CAPTURE( msg ) INTERNAL_CATCH_INFO( "CAPTURE", #msg " := " << Catch::toString(msg) ) + +#ifdef CATCH_CONFIG_VARIADIC_MACROS +#define TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE( __VA_ARGS__ ) +#define TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, __VA_ARGS__ ) +#define METHOD_AS_TEST_CASE( method, ... ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, __VA_ARGS__ ) +#define REGISTER_TEST_CASE( Function, ... ) INTERNAL_CATCH_REGISTER_TESTCASE( Function, __VA_ARGS__ ) +#define SECTION( ... ) INTERNAL_CATCH_SECTION( __VA_ARGS__ ) +#define FAIL( ... ) INTERNAL_CATCH_MSG( "FAIL", Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, __VA_ARGS__ ) +#define FAIL_CHECK( ... ) INTERNAL_CATCH_MSG( "FAIL_CHECK", Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ ) +#define SUCCEED( ... ) INTERNAL_CATCH_MSG( "SUCCEED", Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ ) +#else +#define TEST_CASE( name, description ) INTERNAL_CATCH_TESTCASE( name, description ) + #define TEST_CASE_METHOD( className, name, description ) INTERNAL_CATCH_TEST_CASE_METHOD( className, name, description ) + #define METHOD_AS_TEST_CASE( method, name, description ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, name, description ) + #define REGISTER_TEST_CASE( method, name, description ) INTERNAL_CATCH_REGISTER_TESTCASE( method, name, description ) + #define SECTION( name, description ) INTERNAL_CATCH_SECTION( name, description ) + #define FAIL( msg ) INTERNAL_CATCH_MSG( "FAIL", Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, msg ) + #define FAIL_CHECK( msg ) INTERNAL_CATCH_MSG( "FAIL_CHECK", Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::ContinueOnFailure, msg ) + #define SUCCEED( msg ) INTERNAL_CATCH_MSG( "SUCCEED", Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, msg ) +#endif +#define ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE( "", "" ) + +#define REGISTER_REPORTER( name, reporterType ) INTERNAL_CATCH_REGISTER_REPORTER( name, reporterType ) +#define REGISTER_LEGACY_REPORTER( name, reporterType ) INTERNAL_CATCH_REGISTER_LEGACY_REPORTER( name, reporterType ) + +#define GENERATE( expr) INTERNAL_CATCH_GENERATE( expr ) + +#endif + +#define CATCH_TRANSLATE_EXCEPTION( signature ) INTERNAL_CATCH_TRANSLATE_EXCEPTION( signature ) + +// "BDD-style" convenience wrappers +#ifdef CATCH_CONFIG_VARIADIC_MACROS +#define SCENARIO( ... ) TEST_CASE( "Scenario: " __VA_ARGS__ ) +#define SCENARIO_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, "Scenario: " __VA_ARGS__ ) +#else +#define SCENARIO( name, tags ) TEST_CASE( "Scenario: " name, tags ) +#define SCENARIO_METHOD( className, name, tags ) INTERNAL_CATCH_TEST_CASE_METHOD( className, "Scenario: " name, tags ) +#endif +#define GIVEN( desc ) SECTION( std::string(" Given: ") + desc, "" ) +#define WHEN( desc ) SECTION( std::string(" When: ") + desc, "" ) +#define AND_WHEN( desc ) SECTION( std::string("And when: ") + desc, "" ) +#define THEN( desc ) SECTION( std::string(" Then: ") + desc, "" ) +#define AND_THEN( desc ) SECTION( std::string(" And: ") + desc, "" ) + +using Catch::Detail::Approx; + +// #included from: internal/catch_reenable_warnings.h + +#define TWOBLUECUBES_CATCH_REENABLE_WARNINGS_H_INCLUDED + +#ifdef __clang__ +# ifdef __ICC // icpc defines the __clang__ macro +# pragma warning(pop) +# else +# pragma clang diagnostic pop +# endif +#elif defined __GNUC__ +# pragma GCC diagnostic pop +#endif + +#endif // TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED + diff --git a/results/.gitignore b/results/.gitignore new file mode 100644 index 0000000..e34b598 --- /dev/null +++ b/results/.gitignore @@ -0,0 +1 @@ +plots/ diff --git a/results/ct/data/ct_fixediv_dep_fixedi b/results/ct/data/ct_fixediv_dep_fixedi new file mode 100644 index 0000000..76e05b3 --- /dev/null +++ b/results/ct/data/ct_fixediv_dep_fixedi @@ -0,0 +1,200 @@ +100:real 6.55:user 5.98:sys 0.47: +100:real 6.77:user 6.05:sys 0.65: +100:real 6.50:user 5.98:sys 0.45: +100:real 6.44:user 5.93:sys 0.45: +100:real 6.73:user 6.05:sys 0.59: +100:real 6.52:user 5.97:sys 0.49: +100:real 6.49:user 5.95:sys 0.49: +100:real 6.69:user 6.06:sys 0.56: +100:real 6.39:user 5.78:sys 0.52: +100:real 6.47:user 5.93:sys 0.48: +100:real 6.54:user 6.01:sys 0.46: +100:real 6.42:user 5.90:sys 0.47: +100:real 6.46:user 5.91:sys 0.46: +100:real 6.39:user 5.89:sys 0.45: +100:real 6.48:user 5.95:sys 0.47: +100:real 6.49:user 5.95:sys 0.48: +100:real 6.51:user 5.92:sys 0.51: +100:real 6.49:user 5.98:sys 0.45: +100:real 6.49:user 5.96:sys 0.47: +100:real 6.47:user 5.94:sys 0.47: +10:real 7.84:user 7.15:sys 0.59: +10:real 7.79:user 7.07:sys 0.67: +10:real 7.87:user 7.16:sys 0.66: +10:real 7.83:user 7.14:sys 0.64: +10:real 7.85:user 7.16:sys 0.62: +10:real 7.80:user 7.13:sys 0.62: +10:real 7.84:user 7.12:sys 0.66: +10:real 7.80:user 7.09:sys 0.64: +10:real 7.96:user 7.19:sys 0.67: +10:real 7.87:user 7.14:sys 0.66: +10:real 7.81:user 7.14:sys 0.62: +10:real 7.63:user 6.99:sys 0.59: +10:real 7.90:user 7.16:sys 0.66: +10:real 8.57:user 7.67:sys 0.84: +10:real 7.82:user 7.18:sys 0.58: +10:real 7.87:user 7.16:sys 0.63: +10:real 7.83:user 7.16:sys 0.61: +10:real 7.82:user 7.14:sys 0.62: +10:real 7.85:user 7.16:sys 0.63: +10:real 7.80:user 7.08:sys 0.65: +20:real 8.11:user 7.32:sys 0.73: +20:real 7.94:user 7.20:sys 0.68: +20:real 7.35:user 6.70:sys 0.58: +20:real 7.36:user 6.70:sys 0.57: +20:real 7.31:user 6.68:sys 0.57: +20:real 7.32:user 6.69:sys 0.57: +20:real 7.29:user 6.68:sys 0.56: +20:real 7.33:user 6.68:sys 0.57: +20:real 7.29:user 6.64:sys 0.59: +20:real 7.31:user 6.71:sys 0.54: +20:real 7.28:user 6.66:sys 0.56: +20:real 7.33:user 6.69:sys 0.56: +20:real 7.28:user 6.68:sys 0.54: +20:real 7.31:user 6.70:sys 0.55: +20:real 7.31:user 6.70:sys 0.55: +20:real 7.33:user 6.70:sys 0.55: +20:real 7.31:user 6.68:sys 0.58: +20:real 7.40:user 6.74:sys 0.59: +20:real 7.30:user 6.65:sys 0.59: +20:real 7.26:user 6.61:sys 0.56: +30:real 8.65:user 7.89:sys 0.69: +30:real 8.81:user 7.91:sys 0.82: +30:real 8.71:user 7.87:sys 0.74: +30:real 8.70:user 7.96:sys 0.67: +30:real 8.69:user 7.92:sys 0.69: +30:real 8.79:user 8.00:sys 0.71: +30:real 8.74:user 7.82:sys 0.85: +30:real 8.87:user 7.75:sys 1.05: +30:real 9.01:user 8.15:sys 0.76: +30:real 8.78:user 7.88:sys 0.83: +30:real 9.11:user 8.19:sys 0.85: +30:real 8.70:user 7.91:sys 0.70: +30:real 8.68:user 7.92:sys 0.69: +30:real 8.56:user 7.86:sys 0.64: +30:real 8.63:user 7.81:sys 0.71: +30:real 8.43:user 7.72:sys 0.66: +30:real 8.66:user 7.90:sys 0.70: +30:real 8.68:user 7.90:sys 0.69: +30:real 8.41:user 7.68:sys 0.67: +30:real 8.61:user 7.87:sys 0.68: +40:real 10.21:user 9.38:sys 0.75: +40:real 10.12:user 9.30:sys 0.76: +40:real 10.15:user 9.33:sys 0.75: +40:real 9.90:user 9.20:sys 0.60: +40:real 10.09:user 9.29:sys 0.74: +40:real 10.23:user 9.34:sys 0.83: +40:real 10.26:user 9.39:sys 0.77: +40:real 10.44:user 9.57:sys 0.79: +40:real 10.19:user 9.33:sys 0.78: +40:real 10.22:user 9.36:sys 0.76: +40:real 10.31:user 9.44:sys 0.79: +40:real 10.49:user 9.58:sys 0.83: +40:real 10.61:user 9.62:sys 0.90: +40:real 10.83:user 9.83:sys 0.92: +40:real 10.75:user 9.61:sys 1.06: +40:real 10.71:user 9.63:sys 0.97: +40:real 11.78:user 10.16:sys 1.55: +40:real 10.87:user 9.67:sys 1.13: +40:real 11.21:user 10.01:sys 1.08: +40:real 10.25:user 9.44:sys 0.74: +50:real 7.87:user 7.25:sys 0.56: +50:real 8.21:user 7.21:sys 0.90: +50:real 7.65:user 6.98:sys 0.60: +50:real 7.84:user 7.17:sys 0.60: +50:real 7.82:user 7.20:sys 0.57: +50:real 7.91:user 7.24:sys 0.58: +50:real 7.84:user 7.16:sys 0.62: +50:real 7.74:user 7.12:sys 0.56: +50:real 7.80:user 7.18:sys 0.57: +50:real 7.88:user 7.20:sys 0.60: +50:real 7.75:user 7.11:sys 0.58: +50:real 7.79:user 7.16:sys 0.57: +50:real 7.79:user 7.14:sys 0.59: +50:real 7.62:user 6.92:sys 0.62: +50:real 7.58:user 6.98:sys 0.55: +50:real 7.84:user 7.21:sys 0.57: +50:real 7.81:user 7.16:sys 0.59: +50:real 7.77:user 7.03:sys 0.63: +50:real 7.85:user 7.21:sys 0.59: +50:real 7.95:user 7.15:sys 0.73: +60:real 9.43:user 8.68:sys 0.67: +60:real 9.72:user 8.82:sys 0.79: +60:real 9.76:user 8.83:sys 0.85: +60:real 9.58:user 8.71:sys 0.80: +60:real 9.63:user 8.67:sys 0.86: +60:real 9.51:user 8.54:sys 0.90: +60:real 9.48:user 8.64:sys 0.77: +60:real 9.55:user 8.71:sys 0.74: +60:real 9.46:user 8.68:sys 0.72: +60:real 9.48:user 8.71:sys 0.70: +60:real 9.51:user 8.69:sys 0.72: +60:real 9.47:user 8.70:sys 0.69: +60:real 9.27:user 8.52:sys 0.68: +60:real 9.36:user 8.62:sys 0.66: +60:real 9.41:user 8.66:sys 0.70: +60:real 9.42:user 8.66:sys 0.70: +60:real 9.43:user 8.63:sys 0.71: +60:real 9.35:user 8.61:sys 0.68: +60:real 9.38:user 8.66:sys 0.66: +60:real 9.39:user 8.66:sys 0.65: +70:real 12.68:user 11.66:sys 0.96: +70:real 11.41:user 10.58:sys 0.77: +70:real 11.48:user 10.58:sys 0.81: +70:real 11.73:user 10.79:sys 0.86: +70:real 11.82:user 10.90:sys 0.84: +70:real 11.91:user 10.84:sys 0.98: +70:real 12.07:user 10.97:sys 1.02: +70:real 11.21:user 10.40:sys 0.72: +70:real 11.51:user 10.65:sys 0.80: +70:real 11.44:user 10.65:sys 0.72: +70:real 12.05:user 11.05:sys 0.91: +70:real 11.43:user 10.59:sys 0.78: +70:real 12.10:user 11.13:sys 0.91: +70:real 11.41:user 10.59:sys 0.73: +70:real 11.40:user 10.58:sys 0.75: +70:real 11.42:user 10.62:sys 0.73: +70:real 11.88:user 10.89:sys 0.88: +70:real 11.80:user 10.79:sys 0.94: +70:real 11.76:user 10.84:sys 0.84: +70:real 11.55:user 10.53:sys 0.90: +80:real 9.88:user 9.12:sys 0.69: +80:real 10.17:user 9.35:sys 0.74: +80:real 10.03:user 9.18:sys 0.74: +80:real 9.96:user 9.16:sys 0.72: +80:real 9.94:user 9.16:sys 0.71: +80:real 9.93:user 9.15:sys 0.68: +80:real 9.95:user 9.21:sys 0.68: +80:real 9.99:user 9.18:sys 0.73: +80:real 10.04:user 9.19:sys 0.75: +80:real 9.90:user 9.12:sys 0.71: +80:real 10.05:user 9.25:sys 0.73: +80:real 9.90:user 9.06:sys 0.74: +80:real 9.93:user 9.16:sys 0.70: +80:real 9.90:user 9.18:sys 0.66: +80:real 9.87:user 9.06:sys 0.73: +80:real 9.92:user 9.11:sys 0.74: +80:real 9.91:user 9.14:sys 0.71: +80:real 9.95:user 9.21:sys 0.65: +80:real 9.91:user 9.17:sys 0.68: +80:real 9.89:user 9.15:sys 0.68: +90:real 8.56:user 7.88:sys 0.59: +90:real 8.50:user 7.85:sys 0.59: +90:real 8.47:user 7.82:sys 0.60: +90:real 8.55:user 7.84:sys 0.62: +90:real 8.43:user 7.77:sys 0.59: +90:real 8.55:user 7.92:sys 0.56: +90:real 8.54:user 7.85:sys 0.60: +90:real 8.71:user 7.93:sys 0.70: +90:real 8.88:user 7.89:sys 0.92: +90:real 8.95:user 8.19:sys 0.65: +90:real 8.87:user 8.09:sys 0.70: +90:real 8.64:user 7.93:sys 0.64: +90:real 8.62:user 7.92:sys 0.60: +90:real 8.55:user 7.85:sys 0.63: +90:real 8.45:user 7.80:sys 0.59: +90:real 8.83:user 7.96:sys 0.76: +90:real 9.03:user 8.06:sys 0.89: +90:real 8.84:user 8.11:sys 0.66: +90:real 8.92:user 8.05:sys 0.77: +90:real 8.60:user 7.92:sys 0.60: diff --git a/results/ct/data/ct_fixediv_dep_randi b/results/ct/data/ct_fixediv_dep_randi new file mode 100644 index 0000000..5e59d90 --- /dev/null +++ b/results/ct/data/ct_fixediv_dep_randi @@ -0,0 +1,200 @@ +100:real 14.13:user 13.23:sys 0.83: +100:real 16.08:user 14.61:sys 1.34: +100:real 15.54:user 14.21:sys 1.25: +100:real 14.69:user 13.48:sys 1.08: +100:real 14.88:user 13.77:sys 1.03: +100:real 14.84:user 13.44:sys 1.28: +100:real 15.04:user 13.95:sys 1.01: +100:real 14.73:user 13.35:sys 1.26: +100:real 14.95:user 13.86:sys 1.02: +100:real 16.18:user 14.38:sys 1.67: +100:real 15.79:user 14.53:sys 1.18: +100:real 14.16:user 13.23:sys 0.84: +100:real 14.17:user 13.22:sys 0.88: +100:real 14.33:user 13.34:sys 0.90: +100:real 14.24:user 13.35:sys 0.83: +100:real 13.88:user 12.95:sys 0.84: +100:real 14.20:user 13.32:sys 0.82: +100:real 14.23:user 13.31:sys 0.83: +100:real 14.23:user 13.15:sys 1.00: +100:real 14.86:user 13.68:sys 1.07: +10:real 10.93:user 10.07:sys 0.79: +10:real 11.09:user 10.09:sys 0.89: +10:real 12.03:user 10.83:sys 1.13: +10:real 11.21:user 10.25:sys 0.90: +10:real 11.59:user 10.54:sys 0.95: +10:real 11.77:user 10.58:sys 1.11: +10:real 11.81:user 10.73:sys 1.01: +10:real 11.37:user 10.18:sys 1.09: +10:real 10.99:user 10.16:sys 0.78: +10:real 11.09:user 10.19:sys 0.80: +10:real 11.03:user 10.20:sys 0.75: +10:real 11.01:user 10.13:sys 0.82: +10:real 10.99:user 10.17:sys 0.76: +10:real 11.08:user 10.21:sys 0.80: +10:real 11.00:user 10.12:sys 0.82: +10:real 10.99:user 10.18:sys 0.75: +10:real 12.39:user 11.10:sys 1.19: +10:real 11.23:user 10.25:sys 0.91: +10:real 11.26:user 10.29:sys 0.89: +10:real 12.38:user 11.20:sys 1.08: +20:real 9.86:user 9.06:sys 0.73: +20:real 10.67:user 9.60:sys 1.01: +20:real 10.75:user 9.71:sys 0.95: +20:real 10.68:user 9.73:sys 0.87: +20:real 10.93:user 9.83:sys 1.02: +20:real 10.41:user 9.20:sys 1.12: +20:real 10.38:user 9.28:sys 1.03: +20:real 10.20:user 9.16:sys 0.97: +20:real 10.10:user 9.14:sys 0.87: +20:real 10.06:user 9.15:sys 0.84: +20:real 10.00:user 9.11:sys 0.80: +20:real 9.99:user 9.14:sys 0.76: +20:real 9.90:user 9.03:sys 0.79: +20:real 10.10:user 9.19:sys 0.84: +20:real 10.06:user 9.14:sys 0.82: +20:real 9.87:user 9.12:sys 0.68: +20:real 9.87:user 9.02:sys 0.78: +20:real 10.11:user 9.11:sys 0.90: +20:real 10.06:user 9.10:sys 0.89: +20:real 10.07:user 9.12:sys 0.87: +30:real 9.61:user 8.79:sys 0.73: +30:real 9.75:user 8.87:sys 0.81: +30:real 10.17:user 9.07:sys 1.03: +30:real 9.79:user 8.93:sys 0.76: +30:real 10.18:user 9.08:sys 1.03: +30:real 10.07:user 8.99:sys 1.01: +30:real 10.10:user 9.06:sys 0.95: +30:real 9.86:user 9.00:sys 0.79: +30:real 10.12:user 9.04:sys 1.00: +30:real 10.11:user 9.08:sys 0.93: +30:real 9.75:user 8.99:sys 0.69: +30:real 10.13:user 9.07:sys 0.99: +30:real 10.14:user 9.10:sys 0.94: +30:real 10.07:user 9.13:sys 0.88: +30:real 9.99:user 9.02:sys 0.89: +30:real 10.04:user 9.03:sys 0.91: +30:real 9.99:user 9.06:sys 0.86: +30:real 9.74:user 8.93:sys 0.74: +30:real 9.98:user 8.87:sys 1.01: +30:real 9.94:user 8.89:sys 0.98: +40:real 9.81:user 8.96:sys 0.78: +40:real 9.86:user 9.05:sys 0.71: +40:real 10.18:user 9.33:sys 0.79: +40:real 10.00:user 8.91:sys 1.01: +40:real 10.20:user 9.05:sys 1.05: +40:real 10.03:user 8.95:sys 1.01: +40:real 10.00:user 9.01:sys 0.92: +40:real 10.08:user 8.97:sys 1.01: +40:real 10.03:user 9.03:sys 0.92: +40:real 10.01:user 9.01:sys 0.93: +40:real 10.01:user 8.98:sys 0.93: +40:real 9.78:user 8.93:sys 0.78: +40:real 10.09:user 9.02:sys 1.00: +40:real 10.02:user 8.92:sys 1.00: +40:real 10.03:user 8.97:sys 0.98: +40:real 10.05:user 9.00:sys 0.97: +40:real 9.96:user 8.86:sys 1.01: +40:real 9.97:user 8.94:sys 0.96: +40:real 9.94:user 8.88:sys 0.98: +40:real 10.03:user 8.88:sys 1.04: +50:real 10.79:user 9.70:sys 1.02: +50:real 10.89:user 9.91:sys 0.89: +50:real 10.82:user 9.85:sys 0.87: +50:real 11.05:user 10.00:sys 0.97: +50:real 10.76:user 9.80:sys 0.88: +50:real 11.76:user 10.46:sys 1.20: +50:real 11.04:user 10.00:sys 0.96: +50:real 11.80:user 10.69:sys 1.05: +50:real 11.22:user 10.09:sys 1.03: +50:real 10.68:user 9.60:sys 1.01: +50:real 10.38:user 9.52:sys 0.79: +50:real 10.78:user 9.79:sys 0.89: +50:real 10.81:user 9.83:sys 0.90: +50:real 10.69:user 9.74:sys 0.87: +50:real 10.78:user 9.82:sys 0.87: +50:real 10.82:user 9.84:sys 0.90: +50:real 12.53:user 10.81:sys 1.65: +50:real 11.23:user 10.15:sys 0.99: +50:real 11.30:user 10.20:sys 1.02: +50:real 10.73:user 9.64:sys 1.02: +60:real 11.30:user 10.34:sys 0.84: +60:real 11.76:user 10.73:sys 0.96: +60:real 11.62:user 10.65:sys 0.90: +60:real 12.02:user 10.96:sys 0.95: +60:real 12.22:user 11.05:sys 1.09: +60:real 11.49:user 10.63:sys 0.77: +60:real 11.52:user 10.59:sys 0.87: +60:real 12.73:user 11.64:sys 1.03: +60:real 11.56:user 10.67:sys 0.80: +60:real 11.54:user 10.64:sys 0.84: +60:real 11.49:user 10.61:sys 0.83: +60:real 11.55:user 10.67:sys 0.81: +60:real 11.50:user 10.63:sys 0.81: +60:real 11.50:user 10.59:sys 0.85: +60:real 12.14:user 11.07:sys 0.98: +60:real 12.30:user 11.08:sys 1.15: +60:real 12.33:user 10.99:sys 1.23: +60:real 11.49:user 10.60:sys 0.83: +60:real 11.50:user 10.65:sys 0.79: +60:real 11.55:user 10.64:sys 0.82: +70:real 12.00:user 11.10:sys 0.83: +70:real 12.00:user 11.11:sys 0.82: +70:real 12.03:user 11.08:sys 0.86: +70:real 13.33:user 12.07:sys 1.19: +70:real 13.29:user 11.97:sys 1.22: +70:real 12.95:user 11.78:sys 1.08: +70:real 13.29:user 11.95:sys 1.23: +70:real 12.66:user 11.56:sys 1.02: +70:real 12.84:user 11.47:sys 1.28: +70:real 12.31:user 11.17:sys 1.05: +70:real 12.21:user 11.13:sys 0.98: +70:real 13.12:user 11.95:sys 1.10: +70:real 12.80:user 11.69:sys 1.01: +70:real 11.96:user 11.08:sys 0.80: +70:real 12.23:user 11.14:sys 0.98: +70:real 12.64:user 11.56:sys 1.00: +70:real 12.74:user 11.59:sys 1.04: +70:real 12.02:user 11.10:sys 0.84: +70:real 12.12:user 11.05:sys 0.98: +70:real 12.50:user 11.40:sys 1.02: +80:real 12.84:user 11.90:sys 0.84: +80:real 13.07:user 11.76:sys 1.22: +80:real 13.06:user 11.99:sys 0.97: +80:real 13.36:user 12.24:sys 1.04: +80:real 13.28:user 11.97:sys 1.19: +80:real 12.98:user 11.90:sys 1.01: +80:real 13.45:user 12.31:sys 1.02: +80:real 13.50:user 12.27:sys 1.14: +80:real 13.11:user 11.99:sys 1.02: +80:real 13.44:user 12.38:sys 0.98: +80:real 13.52:user 12.24:sys 1.16: +80:real 13.03:user 11.93:sys 1.02: +80:real 13.43:user 12.29:sys 1.03: +80:real 13.57:user 12.28:sys 1.20: +80:real 13.07:user 11.98:sys 0.98: +80:real 13.37:user 12.36:sys 0.93: +80:real 12.87:user 11.82:sys 0.93: +80:real 14.25:user 13.00:sys 1.17: +80:real 13.33:user 12.26:sys 0.97: +80:real 13.49:user 12.17:sys 1.23: +90:real 13.81:user 12.85:sys 0.86: +90:real 15.11:user 13.75:sys 1.28: +90:real 13.81:user 12.84:sys 0.88: +90:real 13.83:user 12.87:sys 0.89: +90:real 13.84:user 12.89:sys 0.86: +90:real 13.76:user 12.85:sys 0.85: +90:real 13.78:user 12.84:sys 0.85: +90:real 13.42:user 12.55:sys 0.80: +90:real 13.79:user 12.86:sys 0.85: +90:real 14.82:user 13.59:sys 1.14: +90:real 15.25:user 13.93:sys 1.22: +90:real 14.75:user 13.53:sys 1.13: +90:real 13.93:user 12.81:sys 1.02: +90:real 15.02:user 13.72:sys 1.23: +90:real 15.09:user 13.81:sys 1.19: +90:real 13.77:user 12.89:sys 0.82: +90:real 14.12:user 13.08:sys 0.95: +90:real 13.46:user 12.56:sys 0.84: +90:real 14.78:user 13.66:sys 1.02: +90:real 13.76:user 12.86:sys 0.83: diff --git a/results/ct/data/ct_fixediv_indep_fixedi b/results/ct/data/ct_fixediv_indep_fixedi new file mode 100644 index 0000000..6a0667b --- /dev/null +++ b/results/ct/data/ct_fixediv_indep_fixedi @@ -0,0 +1,200 @@ +100:real 11.14:user 10.24:sys 0.78: +100:real 11.01:user 10.24:sys 0.70: +100:real 11.80:user 10.79:sys 0.95: +100:real 11.99:user 10.94:sys 0.96: +100:real 11.85:user 10.79:sys 1.00: +100:real 10.99:user 10.24:sys 0.69: +100:real 11.43:user 10.38:sys 0.93: +100:real 11.12:user 10.29:sys 0.75: +100:real 11.06:user 10.22:sys 0.76: +100:real 10.99:user 10.14:sys 0.75: +100:real 11.18:user 10.33:sys 0.78: +100:real 11.27:user 10.36:sys 0.82: +100:real 11.67:user 10.68:sys 0.88: +100:real 11.83:user 10.78:sys 0.96: +100:real 10.96:user 10.20:sys 0.68: +100:real 11.18:user 10.27:sys 0.80: +100:real 11.10:user 10.24:sys 0.79: +100:real 11.07:user 10.26:sys 0.72: +100:real 11.18:user 10.26:sys 0.81: +100:real 11.00:user 10.15:sys 0.76: +10:real 7.18:user 6.53:sys 0.59: +10:real 7.28:user 6.62:sys 0.57: +10:real 7.23:user 6.57:sys 0.60: +10:real 7.00:user 6.41:sys 0.53: +10:real 7.22:user 6.58:sys 0.57: +10:real 7.25:user 6.62:sys 0.55: +10:real 7.25:user 6.67:sys 0.51: +10:real 7.22:user 6.61:sys 0.54: +10:real 7.25:user 6.63:sys 0.56: +10:real 7.76:user 6.92:sys 0.76: +10:real 7.20:user 6.53:sys 0.60: +10:real 7.65:user 6.87:sys 0.71: +10:real 7.35:user 6.66:sys 0.62: +10:real 7.32:user 6.62:sys 0.61: +10:real 7.17:user 6.58:sys 0.53: +10:real 7.46:user 6.68:sys 0.70: +10:real 7.25:user 6.61:sys 0.58: +10:real 7.28:user 6.64:sys 0.55: +10:real 7.24:user 6.64:sys 0.55: +10:real 7.27:user 6.65:sys 0.57: +20:real 7.61:user 6.97:sys 0.58: +20:real 7.61:user 6.93:sys 0.60: +20:real 7.58:user 6.92:sys 0.60: +20:real 7.40:user 6.78:sys 0.56: +20:real 7.59:user 6.96:sys 0.58: +20:real 7.64:user 7.02:sys 0.54: +20:real 7.65:user 7.01:sys 0.58: +20:real 7.58:user 6.95:sys 0.57: +20:real 7.58:user 6.93:sys 0.60: +20:real 7.65:user 6.97:sys 0.59: +20:real 8.12:user 7.31:sys 0.74: +20:real 7.88:user 7.06:sys 0.75: +20:real 7.57:user 6.87:sys 0.62: +20:real 7.47:user 6.80:sys 0.57: +20:real 7.52:user 6.85:sys 0.61: +20:real 8.13:user 7.28:sys 0.78: +20:real 7.50:user 6.89:sys 0.54: +20:real 7.62:user 6.95:sys 0.59: +20:real 7.55:user 6.89:sys 0.59: +20:real 8.08:user 7.30:sys 0.70: +30:real 9.19:user 8.45:sys 0.67: +30:real 9.73:user 8.79:sys 0.83: +30:real 9.69:user 8.77:sys 0.85: +30:real 9.68:user 8.83:sys 0.78: +30:real 9.75:user 8.80:sys 0.85: +30:real 9.70:user 8.78:sys 0.84: +30:real 9.60:user 8.72:sys 0.81: +30:real 9.46:user 8.61:sys 0.75: +30:real 9.33:user 8.52:sys 0.74: +30:real 9.27:user 8.46:sys 0.74: +30:real 9.28:user 8.50:sys 0.69: +30:real 9.22:user 8.46:sys 0.69: +30:real 9.58:user 8.56:sys 0.94: +30:real 9.72:user 8.57:sys 1.05: +30:real 9.20:user 8.47:sys 0.66: +30:real 9.97:user 9.11:sys 0.78: +30:real 9.97:user 9.06:sys 0.80: +30:real 9.96:user 9.08:sys 0.80: +30:real 9.91:user 9.09:sys 0.75: +30:real 9.94:user 9.04:sys 0.81: +40:real 9.90:user 9.18:sys 0.66: +40:real 9.68:user 8.97:sys 0.64: +40:real 9.98:user 9.17:sys 0.71: +40:real 9.93:user 9.16:sys 0.70: +40:real 10.80:user 9.80:sys 0.92: +40:real 9.97:user 9.20:sys 0.68: +40:real 9.93:user 9.14:sys 0.71: +40:real 9.89:user 9.14:sys 0.68: +40:real 9.96:user 9.18:sys 0.69: +40:real 10.78:user 9.85:sys 0.86: +40:real 10.60:user 9.47:sys 1.06: +40:real 10.48:user 9.30:sys 1.10: +40:real 10.34:user 9.31:sys 0.95: +40:real 10.22:user 9.26:sys 0.88: +40:real 10.08:user 9.22:sys 0.75: +40:real 10.08:user 9.23:sys 0.77: +40:real 9.90:user 9.08:sys 0.74: +40:real 9.97:user 9.07:sys 0.79: +40:real 10.00:user 9.19:sys 0.73: +40:real 10.04:user 9.22:sys 0.74: +50:real 10.72:user 9.84:sys 0.77: +50:real 10.73:user 9.94:sys 0.74: +50:real 10.68:user 9.85:sys 0.77: +50:real 10.75:user 9.94:sys 0.73: +50:real 10.43:user 9.61:sys 0.76: +50:real 10.69:user 9.89:sys 0.74: +50:real 10.72:user 9.87:sys 0.76: +50:real 10.73:user 9.90:sys 0.77: +50:real 10.71:user 9.86:sys 0.78: +50:real 10.72:user 9.87:sys 0.77: +50:real 11.43:user 10.37:sys 0.99: +50:real 11.22:user 10.01:sys 1.13: +50:real 10.94:user 9.88:sys 0.94: +50:real 10.76:user 9.87:sys 0.81: +50:real 11.80:user 10.83:sys 0.91: +50:real 10.84:user 9.88:sys 0.87: +50:real 10.70:user 9.84:sys 0.81: +50:real 10.67:user 9.84:sys 0.77: +50:real 10.70:user 9.82:sys 0.80: +50:real 10.43:user 9.60:sys 0.77: +60:real 11.03:user 10.20:sys 0.77: +60:real 11.09:user 10.26:sys 0.75: +60:real 11.37:user 10.21:sys 1.09: +60:real 10.96:user 10.12:sys 0.75: +60:real 12.37:user 11.32:sys 0.95: +60:real 10.98:user 10.15:sys 0.76: +60:real 11.87:user 10.73:sys 1.07: +60:real 11.45:user 10.36:sys 0.99: +60:real 11.67:user 10.66:sys 0.93: +60:real 11.29:user 10.19:sys 1.01: +60:real 11.13:user 10.26:sys 0.78: +60:real 11.07:user 10.21:sys 0.79: +60:real 11.06:user 10.21:sys 0.79: +60:real 11.17:user 10.26:sys 0.83: +60:real 11.08:user 10.27:sys 0.75: +60:real 12.26:user 11.21:sys 0.99: +60:real 11.09:user 10.18:sys 0.81: +60:real 11.04:user 10.26:sys 0.72: +60:real 11.02:user 10.16:sys 0.79: +60:real 11.06:user 10.18:sys 0.79: +70:real 12.60:user 11.32:sys 1.21: +70:real 11.75:user 10.78:sys 0.89: +70:real 12.13:user 11.08:sys 0.94: +70:real 12.21:user 10.98:sys 1.15: +70:real 11.43:user 10.46:sys 0.86: +70:real 11.18:user 10.28:sys 0.82: +70:real 11.84:user 10.83:sys 0.93: +70:real 12.05:user 10.96:sys 0.99: +70:real 11.21:user 10.38:sys 0.75: +70:real 11.44:user 10.32:sys 1.05: +70:real 11.24:user 10.39:sys 0.77: +70:real 11.01:user 10.22:sys 0.73: +70:real 11.26:user 10.46:sys 0.73: +70:real 11.32:user 10.52:sys 0.71: +70:real 11.26:user 10.44:sys 0.75: +70:real 11.28:user 10.47:sys 0.75: +70:real 11.32:user 10.51:sys 0.73: +70:real 11.94:user 10.93:sys 0.95: +70:real 12.53:user 11.43:sys 1.03: +70:real 11.55:user 10.59:sys 0.87: +80:real 11.38:user 10.58:sys 0.72: +80:real 12.13:user 11.06:sys 1.01: +80:real 11.37:user 10.55:sys 0.72: +80:real 11.37:user 10.60:sys 0.69: +80:real 11.62:user 10.70:sys 0.85: +80:real 11.65:user 10.67:sys 0.88: +80:real 11.87:user 10.93:sys 0.86: +80:real 12.02:user 10.92:sys 1.03: +80:real 11.64:user 10.47:sys 1.07: +80:real 11.53:user 10.64:sys 0.81: +80:real 11.45:user 10.63:sys 0.75: +80:real 11.85:user 10.87:sys 0.88: +80:real 11.35:user 10.58:sys 0.69: +80:real 11.90:user 10.87:sys 0.95: +80:real 12.11:user 10.98:sys 1.04: +80:real 11.51:user 10.66:sys 0.77: +80:real 11.11:user 10.35:sys 0.70: +80:real 11.42:user 10.65:sys 0.68: +80:real 11.44:user 10.66:sys 0.71: +80:real 12.23:user 11.17:sys 1.00: +90:real 11.58:user 10.74:sys 0.75: +90:real 11.54:user 10.73:sys 0.75: +90:real 11.23:user 10.46:sys 0.71: +90:real 11.60:user 10.73:sys 0.78: +90:real 11.82:user 10.95:sys 0.79: +90:real 12.06:user 10.94:sys 1.05: +90:real 12.21:user 11.09:sys 1.01: +90:real 11.58:user 10.74:sys 0.76: +90:real 11.95:user 11.01:sys 0.86: +90:real 11.94:user 11.01:sys 0.82: +90:real 11.92:user 10.90:sys 0.93: +90:real 12.19:user 11.07:sys 1.05: +90:real 11.71:user 10.68:sys 0.92: +90:real 11.93:user 11.00:sys 0.85: +90:real 11.88:user 10.94:sys 0.86: +90:real 11.96:user 10.96:sys 0.89: +90:real 12.21:user 11.24:sys 0.90: +90:real 11.74:user 10.67:sys 0.97: +90:real 11.78:user 10.89:sys 0.82: +90:real 11.92:user 10.93:sys 0.91: diff --git a/results/ct/data/ct_fixediv_indep_randi b/results/ct/data/ct_fixediv_indep_randi new file mode 100644 index 0000000..4c7fc24 --- /dev/null +++ b/results/ct/data/ct_fixediv_indep_randi @@ -0,0 +1,200 @@ +100:real 14.24:user 13.32:sys 0.81: +100:real 14.19:user 13.31:sys 0.79: +100:real 14.23:user 13.28:sys 0.85: +100:real 14.20:user 13.31:sys 0.80: +100:real 14.26:user 13.34:sys 0.82: +100:real 13.82:user 12.93:sys 0.81: +100:real 14.36:user 13.41:sys 0.84: +100:real 14.23:user 13.37:sys 0.79: +100:real 14.31:user 13.38:sys 0.81: +100:real 15.17:user 13.55:sys 1.54: +100:real 15.43:user 14.08:sys 1.23: +100:real 15.04:user 13.91:sys 1.04: +100:real 15.13:user 13.78:sys 1.24: +100:real 15.02:user 13.93:sys 1.01: +100:real 15.35:user 14.01:sys 1.22: +100:real 14.98:user 13.90:sys 1.01: +100:real 14.95:user 13.57:sys 1.25: +100:real 15.54:user 14.20:sys 1.26: +100:real 14.57:user 13.25:sys 1.21: +100:real 15.07:user 13.93:sys 1.05: +10:real 11.98:user 10.71:sys 1.17: +10:real 11.86:user 10.95:sys 0.85: +10:real 11.85:user 10.98:sys 0.81: +10:real 11.88:user 11.01:sys 0.78: +10:real 11.82:user 10.95:sys 0.80: +10:real 11.58:user 10.71:sys 0.81: +10:real 11.90:user 10.93:sys 0.88: +10:real 11.92:user 11.01:sys 0.85: +10:real 11.84:user 10.94:sys 0.83: +10:real 11.84:user 10.93:sys 0.81: +10:real 12.45:user 11.40:sys 0.97: +10:real 11.93:user 10.76:sys 1.05: +10:real 11.98:user 10.98:sys 0.92: +10:real 12.44:user 11.42:sys 0.94: +10:real 12.62:user 11.28:sys 1.24: +10:real 12.35:user 11.11:sys 1.16: +10:real 11.91:user 11.00:sys 0.83: +10:real 13.40:user 12.14:sys 1.19: +10:real 11.89:user 10.96:sys 0.84: +10:real 13.11:user 11.86:sys 1.19: +20:real 12.66:user 11.62:sys 0.94: +20:real 11.83:user 10.92:sys 0.85: +20:real 12.57:user 11.43:sys 1.06: +20:real 13.15:user 11.92:sys 1.16: +20:real 12.02:user 10.92:sys 0.99: +20:real 12.33:user 11.29:sys 0.96: +20:real 12.62:user 11.36:sys 1.15: +20:real 12.76:user 11.53:sys 1.14: +20:real 12.04:user 11.00:sys 0.94: +20:real 12.42:user 11.36:sys 0.99: +20:real 13.08:user 11.82:sys 1.14: +20:real 12.30:user 10.93:sys 1.29: +20:real 13.22:user 12.06:sys 1.07: +20:real 11.75:user 10.86:sys 0.83: +20:real 11.79:user 10.86:sys 0.85: +20:real 11.76:user 10.91:sys 0.79: +20:real 12.98:user 11.85:sys 1.07: +20:real 11.76:user 10.87:sys 0.81: +20:real 11.75:user 10.92:sys 0.77: +20:real 12.97:user 11.94:sys 0.96: +30:real 12.60:user 11.24:sys 1.25: +30:real 13.52:user 12.34:sys 1.11: +30:real 12.86:user 11.83:sys 0.93: +30:real 13.34:user 12.09:sys 1.17: +30:real 12.54:user 11.46:sys 0.98: +30:real 13.30:user 11.90:sys 1.31: +30:real 13.25:user 12.11:sys 1.04: +30:real 12.38:user 11.37:sys 0.93: +30:real 12.28:user 11.34:sys 0.86: +30:real 12.25:user 11.36:sys 0.82: +30:real 12.34:user 11.39:sys 0.85: +30:real 12.30:user 11.41:sys 0.83: +30:real 12.37:user 11.44:sys 0.85: +30:real 12.26:user 11.37:sys 0.83: +30:real 12.34:user 11.39:sys 0.86: +30:real 12.09:user 11.19:sys 0.82: +30:real 12.68:user 11.54:sys 1.03: +30:real 12.78:user 11.70:sys 1.00: +30:real 13.33:user 12.00:sys 1.23: +30:real 12.52:user 11.42:sys 1.00: +40:real 12.57:user 11.62:sys 0.84: +40:real 13.67:user 12.56:sys 1.03: +40:real 13.89:user 12.56:sys 1.21: +40:real 13.20:user 12.12:sys 1.01: +40:real 13.64:user 12.46:sys 1.08: +40:real 13.50:user 12.14:sys 1.26: +40:real 13.23:user 12.12:sys 1.01: +40:real 13.72:user 12.39:sys 1.25: +40:real 13.22:user 12.11:sys 1.00: +40:real 13.08:user 12.00:sys 1.01: +40:real 13.73:user 12.44:sys 1.19: +40:real 13.31:user 12.12:sys 1.10: +40:real 13.27:user 12.15:sys 1.01: +40:real 13.57:user 12.30:sys 1.19: +40:real 13.25:user 12.08:sys 1.06: +40:real 13.25:user 12.14:sys 1.03: +40:real 13.80:user 12.44:sys 1.27: +40:real 13.13:user 12.04:sys 1.00: +40:real 13.29:user 12.19:sys 1.00: +40:real 13.82:user 12.54:sys 1.20: +50:real 13.77:user 12.81:sys 0.85: +50:real 14.18:user 13.03:sys 1.07: +50:real 14.80:user 13.46:sys 1.23: +50:real 14.02:user 12.94:sys 1.00: +50:real 14.71:user 13.41:sys 1.19: +50:real 13.99:user 12.79:sys 1.12: +50:real 14.92:user 13.53:sys 1.29: +50:real 13.67:user 12.70:sys 0.90: +50:real 13.77:user 12.73:sys 0.95: +50:real 13.73:user 12.71:sys 0.95: +50:real 13.92:user 12.90:sys 0.93: +50:real 13.68:user 12.74:sys 0.86: +50:real 13.80:user 12.77:sys 0.95: +50:real 13.68:user 12.71:sys 0.90: +50:real 13.72:user 12.75:sys 0.88: +50:real 15.28:user 13.98:sys 1.22: +50:real 13.67:user 12.66:sys 0.93: +50:real 13.75:user 12.84:sys 0.85: +50:real 13.71:user 12.73:sys 0.89: +50:real 13.69:user 12.74:sys 0.88: +60:real 13.91:user 12.93:sys 0.88: +60:real 13.88:user 12.90:sys 0.92: +60:real 15.23:user 13.91:sys 1.21: +60:real 14.29:user 13.23:sys 0.98: +60:real 15.58:user 14.19:sys 1.27: +60:real 14.41:user 13.32:sys 1.00: +60:real 14.91:user 13.61:sys 1.18: +60:real 14.12:user 12.98:sys 1.07: +60:real 15.50:user 14.02:sys 1.36: +60:real 14.34:user 13.16:sys 1.11: +60:real 15.47:user 13.96:sys 1.38: +60:real 14.34:user 13.11:sys 1.16: +60:real 15.30:user 13.82:sys 1.36: +60:real 14.24:user 13.11:sys 1.06: +60:real 15.19:user 13.79:sys 1.28: +60:real 14.01:user 12.81:sys 1.12: +60:real 14.63:user 13.42:sys 1.10: +60:real 14.28:user 13.05:sys 1.14: +60:real 13.83:user 12.82:sys 0.90: +60:real 14.72:user 13.46:sys 1.17: +70:real 14.34:user 13.16:sys 1.07: +70:real 15.05:user 13.90:sys 1.06: +70:real 14.26:user 13.14:sys 1.02: +70:real 14.75:user 13.39:sys 1.28: +70:real 14.14:user 13.09:sys 0.95: +70:real 15.25:user 14.03:sys 1.15: +70:real 14.26:user 13.24:sys 0.93: +70:real 14.61:user 13.40:sys 1.15: +70:real 14.72:user 13.49:sys 1.14: +70:real 15.15:user 14.02:sys 1.07: +70:real 14.19:user 13.16:sys 0.93: +70:real 14.44:user 13.35:sys 1.01: +70:real 15.68:user 14.23:sys 1.33: +70:real 14.36:user 13.29:sys 1.00: +70:real 15.19:user 13.97:sys 1.10: +70:real 14.36:user 13.20:sys 1.08: +70:real 14.83:user 13.63:sys 1.09: +70:real 14.21:user 13.11:sys 1.02: +70:real 14.13:user 13.14:sys 0.89: +70:real 15.15:user 13.89:sys 1.18: +80:real 14.18:user 13.19:sys 0.89: +80:real 14.16:user 13.24:sys 0.86: +80:real 14.10:user 13.20:sys 0.82: +80:real 14.09:user 13.12:sys 0.91: +80:real 14.15:user 13.13:sys 0.93: +80:real 14.16:user 13.18:sys 0.92: +80:real 14.26:user 13.23:sys 0.94: +80:real 14.79:user 13.69:sys 1.02: +80:real 14.18:user 12.96:sys 1.10: +80:real 14.59:user 13.37:sys 1.14: +80:real 15.18:user 13.69:sys 1.37: +80:real 14.09:user 13.07:sys 0.94: +80:real 14.84:user 13.57:sys 1.15: +80:real 14.34:user 13.19:sys 1.07: +80:real 14.98:user 13.65:sys 1.21: +80:real 14.37:user 13.19:sys 1.10: +80:real 14.75:user 13.34:sys 1.31: +80:real 14.17:user 13.19:sys 0.91: +80:real 14.14:user 13.16:sys 0.89: +80:real 14.10:user 13.19:sys 0.85: +90:real 14.34:user 13.38:sys 0.86: +90:real 13.83:user 12.96:sys 0.81: +90:real 14.25:user 13.34:sys 0.82: +90:real 14.17:user 13.25:sys 0.85: +90:real 14.49:user 13.31:sys 1.06: +90:real 14.14:user 13.18:sys 0.88: +90:real 15.04:user 13.70:sys 1.23: +90:real 14.17:user 13.25:sys 0.84: +90:real 14.39:user 13.34:sys 0.93: +90:real 14.44:user 13.29:sys 1.07: +90:real 15.22:user 13.76:sys 1.34: +90:real 14.44:user 13.30:sys 1.06: +90:real 14.96:user 13.52:sys 1.33: +90:real 13.85:user 12.96:sys 0.82: +90:real 14.30:user 13.32:sys 0.89: +90:real 14.24:user 13.29:sys 0.88: +90:real 14.29:user 13.28:sys 0.92: +90:real 14.24:user 13.28:sys 0.89: +90:real 15.77:user 14.24:sys 1.43: +90:real 14.28:user 13.28:sys 0.92: diff --git a/results/ct/data/ct_fixedv_dep_fixedi b/results/ct/data/ct_fixedv_dep_fixedi new file mode 100644 index 0000000..73515d3 --- /dev/null +++ b/results/ct/data/ct_fixedv_dep_fixedi @@ -0,0 +1,200 @@ +100:real 77.54:user 69.39:sys 7.94: +100:real 80.44:user 71.34:sys 8.87: +100:real 80.18:user 71.09:sys 8.85: +100:real 81.54:user 72.38:sys 8.93: +100:real 79.61:user 70.79:sys 8.61: +100:real 80.48:user 71.57:sys 8.68: +100:real 80.61:user 71.70:sys 8.71: +100:real 78.85:user 70.37:sys 8.29: +100:real 92.03:user 74.94:sys 16.84: +100:real 81.14:user 72.97:sys 7.97: +100:real 79.25:user 70.57:sys 8.48: +100:real 81.98:user 73.38:sys 8.40: +100:real 77.19:user 69.16:sys 7.83: +100:real 93.98:user 81.86:sys 11.97: +100:real 76.99:user 68.95:sys 7.90: +100:real 93.55:user 81.30:sys 12.06: +100:real 80.74:user 72.64:sys 7.97: +100:real 91.49:user 80.45:sys 10.81: +100:real 81.90:user 72.14:sys 9.55: +100:real 79.62:user 71.55:sys 7.87: +10:real 1.30:user 1.01:sys 0.18: +10:real 1.25:user 1.00:sys 0.19: +10:real 1.22:user 0.97:sys 0.20: +10:real 1.23:user 0.98:sys 0.20: +10:real 1.25:user 1.01:sys 0.18: +10:real 1.30:user 1.03:sys 0.21: +10:real 1.23:user 0.99:sys 0.19: +10:real 1.21:user 1.00:sys 0.16: +10:real 1.22:user 0.99:sys 0.18: +10:real 1.22:user 1.00:sys 0.17: +10:real 1.22:user 1.00:sys 0.17: +10:real 1.22:user 1.00:sys 0.17: +10:real 1.22:user 0.98:sys 0.18: +10:real 1.22:user 1.00:sys 0.17: +10:real 1.24:user 1.00:sys 0.18: +10:real 1.21:user 0.98:sys 0.18: +10:real 1.22:user 0.98:sys 0.19: +10:real 1.20:user 0.96:sys 0.18: +10:real 1.22:user 0.98:sys 0.19: +10:real 1.22:user 0.99:sys 0.18: +20:real 2.39:user 1.99:sys 0.33: +20:real 2.32:user 1.98:sys 0.29: +20:real 2.28:user 1.96:sys 0.27: +20:real 2.26:user 1.91:sys 0.29: +20:real 2.28:user 1.93:sys 0.29: +20:real 2.29:user 1.96:sys 0.28: +20:real 2.27:user 1.92:sys 0.30: +20:real 2.25:user 1.90:sys 0.30: +20:real 2.27:user 1.93:sys 0.29: +20:real 2.26:user 1.92:sys 0.28: +20:real 2.27:user 1.93:sys 0.28: +20:real 2.28:user 1.92:sys 0.30: +20:real 2.31:user 1.97:sys 0.29: +20:real 2.28:user 1.94:sys 0.29: +20:real 2.25:user 1.93:sys 0.27: +20:real 2.29:user 1.91:sys 0.32: +20:real 2.33:user 1.95:sys 0.30: +20:real 2.29:user 1.97:sys 0.27: +20:real 2.30:user 1.95:sys 0.30: +20:real 2.28:user 1.95:sys 0.27: +30:real 3.80:user 3.24:sys 0.50: +30:real 3.80:user 3.25:sys 0.49: +30:real 3.81:user 3.27:sys 0.49: +30:real 3.75:user 3.26:sys 0.44: +30:real 3.80:user 3.28:sys 0.46: +30:real 3.83:user 3.32:sys 0.45: +30:real 3.82:user 3.27:sys 0.50: +30:real 3.80:user 3.26:sys 0.49: +30:real 3.79:user 3.25:sys 0.49: +30:real 3.81:user 3.27:sys 0.49: +30:real 3.80:user 3.29:sys 0.46: +30:real 3.80:user 3.24:sys 0.51: +30:real 3.80:user 3.26:sys 0.50: +30:real 3.80:user 3.27:sys 0.47: +30:real 3.91:user 3.32:sys 0.50: +30:real 3.87:user 3.36:sys 0.46: +30:real 3.83:user 3.28:sys 0.50: +30:real 3.82:user 3.28:sys 0.49: +30:real 3.86:user 3.32:sys 0.48: +30:real 3.83:user 3.26:sys 0.51: +40:real 6.03:user 5.14:sys 0.84: +40:real 6.38:user 5.27:sys 1.04: +40:real 6.03:user 5.18:sys 0.80: +40:real 6.09:user 5.23:sys 0.81: +40:real 6.02:user 5.19:sys 0.78: +40:real 6.03:user 5.18:sys 0.79: +40:real 5.93:user 5.09:sys 0.78: +40:real 6.12:user 5.25:sys 0.79: +40:real 6.08:user 5.26:sys 0.77: +40:real 6.06:user 5.21:sys 0.79: +40:real 6.10:user 5.23:sys 0.82: +40:real 6.57:user 5.45:sys 1.07: +40:real 6.64:user 5.54:sys 1.04: +40:real 6.09:user 5.24:sys 0.80: +40:real 6.07:user 5.23:sys 0.79: +40:real 6.00:user 5.22:sys 0.73: +40:real 6.06:user 5.21:sys 0.79: +40:real 6.84:user 5.43:sys 1.32: +40:real 6.81:user 5.46:sys 1.30: +40:real 7.23:user 5.66:sys 1.50: +50:real 11.13:user 8.84:sys 2.22: +50:real 11.37:user 8.91:sys 2.39: +50:real 10.88:user 8.74:sys 2.06: +50:real 10.92:user 8.80:sys 2.05: +50:real 10.71:user 8.72:sys 1.91: +50:real 10.74:user 8.72:sys 1.96: +50:real 9.73:user 8.39:sys 1.28: +50:real 9.40:user 8.10:sys 1.25: +50:real 9.69:user 8.35:sys 1.29: +50:real 9.72:user 8.40:sys 1.26: +50:real 9.74:user 8.42:sys 1.23: +50:real 9.73:user 8.36:sys 1.32: +50:real 9.77:user 8.42:sys 1.29: +50:real 9.90:user 8.46:sys 1.38: +50:real 9.74:user 8.35:sys 1.34: +50:real 9.65:user 8.38:sys 1.21: +50:real 9.72:user 8.37:sys 1.29: +50:real 9.77:user 8.41:sys 1.26: +50:real 9.67:user 8.30:sys 1.32: +50:real 9.69:user 8.23:sys 1.38: +60:real 14.71:user 12.60:sys 2.05: +60:real 16.28:user 13.65:sys 2.57: +60:real 15.08:user 12.90:sys 2.09: +60:real 15.18:user 13.15:sys 1.96: +60:real 15.04:user 13.02:sys 1.96: +60:real 15.01:user 12.96:sys 1.99: +60:real 15.03:user 12.95:sys 1.98: +60:real 15.05:user 12.99:sys 1.99: +60:real 16.08:user 13.61:sys 2.42: +60:real 15.06:user 13.00:sys 1.99: +60:real 15.02:user 12.83:sys 2.09: +60:real 16.04:user 13.23:sys 2.73: +60:real 18.31:user 13.89:sys 4.35: +60:real 16.56:user 13.86:sys 2.62: +60:real 16.13:user 13.48:sys 2.53: +60:real 16.62:user 13.61:sys 2.93: +60:real 14.73:user 12.66:sys 2.01: +60:real 16.87:user 13.85:sys 2.96: +60:real 16.79:user 13.67:sys 3.03: +60:real 15.05:user 13.01:sys 1.99: +70:real 23.00:user 19.71:sys 3.23: +70:real 21.79:user 18.76:sys 2.96: +70:real 21.97:user 18.46:sys 3.39: +70:real 23.98:user 19.82:sys 4.10: +70:real 24.06:user 20.10:sys 3.89: +70:real 24.12:user 19.91:sys 4.12: +70:real 23.88:user 19.91:sys 3.90: +70:real 22.65:user 18.93:sys 3.63: +70:real 21.64:user 18.35:sys 3.17: +70:real 23.27:user 19.98:sys 3.23: +70:real 21.86:user 18.87:sys 2.93: +70:real 21.79:user 18.86:sys 2.83: +70:real 23.14:user 19.81:sys 3.28: +70:real 22.82:user 19.35:sys 3.38: +70:real 24.59:user 19.53:sys 4.93: +70:real 24.68:user 20.17:sys 4.40: +70:real 23.57:user 19.68:sys 3.80: +70:real 23.22:user 19.35:sys 3.75: +70:real 21.93:user 18.74:sys 3.10: +70:real 23.82:user 20.03:sys 3.69: +80:real 32.84:user 28.57:sys 4.15: +80:real 35.72:user 30.26:sys 5.34: +80:real 35.20:user 29.71:sys 5.36: +80:real 33.62:user 29.03:sys 4.47: +80:real 35.16:user 29.19:sys 5.84: +80:real 32.96:user 28.61:sys 4.25: +80:real 33.29:user 29.03:sys 4.16: +80:real 33.17:user 29.06:sys 4.04: +80:real 33.01:user 28.92:sys 4.00: +80:real 32.86:user 28.69:sys 4.09: +80:real 32.95:user 28.71:sys 4.15: +80:real 31.93:user 27.95:sys 3.92: +80:real 32.91:user 28.86:sys 3.94: +80:real 32.83:user 28.83:sys 3.93: +80:real 32.88:user 28.83:sys 3.95: +80:real 32.57:user 28.25:sys 4.25: +80:real 33.60:user 28.95:sys 4.52: +80:real 35.65:user 29.79:sys 5.75: +80:real 37.22:user 30.37:sys 6.70: +80:real 35.82:user 30.37:sys 5.33: +90:real 47.74:user 41.64:sys 6.02: +90:real 47.48:user 41.58:sys 5.84: +90:real 48.60:user 41.76:sys 6.64: +90:real 48.40:user 41.50:sys 6.77: +90:real 46.70:user 40.96:sys 5.61: +90:real 46.73:user 40.90:sys 5.73: +90:real 47.53:user 41.40:sys 6.04: +90:real 51.14:user 43.38:sys 7.65: +90:real 49.31:user 41.92:sys 7.23: +90:real 47.34:user 41.36:sys 5.85: +90:real 49.56:user 41.57:sys 7.83: +90:real 47.18:user 41.26:sys 5.80: +90:real 47.54:user 40.79:sys 6.61: +90:real 48.35:user 41.22:sys 7.00: +90:real 49.06:user 42.22:sys 6.68: +90:real 49.38:user 42.57:sys 6.68: +90:real 50.27:user 42.25:sys 7.87: +90:real 50.76:user 42.71:sys 7.92: +90:real 49.69:user 42.19:sys 7.34: +90:real 54.83:user 45.00:sys 9.67: diff --git a/results/ct/data/ct_fixedv_dep_randi b/results/ct/data/ct_fixedv_dep_randi new file mode 100644 index 0000000..4d4bfa9 --- /dev/null +++ b/results/ct/data/ct_fixedv_dep_randi @@ -0,0 +1,200 @@ +100:real 181.41:user 166.84:sys 14.27: +100:real 167.88:user 155.16:sys 12.45: +100:real 180.96:user 171.06:sys 9.67: +100:real 164.02:user 154.39:sys 9.31: +100:real 168.53:user 158.10:sys 10.22: +100:real 157.12:user 148.21:sys 8.70: +100:real 163.64:user 153.31:sys 10.02: +100:real 160.52:user 151.37:sys 8.96: +100:real 178.13:user 168.23:sys 9.69: +100:real 154.00:user 144.51:sys 9.21: +100:real 158.53:user 148.77:sys 9.49: +100:real 167.51:user 156.50:sys 10.84: +100:real 158.76:user 149.09:sys 9.41: +100:real 159.12:user 149.53:sys 9.31: +100:real 162.45:user 152.21:sys 10.01: +100:real 163.90:user 154.32:sys 9.33: +100:real 166.35:user 155.23:sys 10.94: +100:real 168.56:user 158.69:sys 9.54: +100:real 156.52:user 147.66:sys 8.66: +100:real 168.04:user 158.83:sys 8.96: +10:real 1.40:user 1.09:sys 0.20: +10:real 1.30:user 1.05:sys 0.20: +10:real 1.32:user 1.07:sys 0.19: +10:real 1.31:user 1.09:sys 0.17: +10:real 1.33:user 1.11:sys 0.16: +10:real 1.31:user 1.09:sys 0.16: +10:real 1.30:user 1.07:sys 0.17: +10:real 1.33:user 1.09:sys 0.19: +10:real 1.29:user 1.06:sys 0.18: +10:real 1.31:user 1.08:sys 0.18: +10:real 1.34:user 1.09:sys 0.19: +10:real 1.32:user 1.08:sys 0.19: +10:real 1.30:user 1.09:sys 0.16: +10:real 1.32:user 1.09:sys 0.17: +10:real 1.32:user 1.08:sys 0.19: +10:real 1.32:user 1.08:sys 0.19: +10:real 1.30:user 1.07:sys 0.19: +10:real 1.33:user 1.07:sys 0.20: +10:real 1.26:user 1.03:sys 0.18: +10:real 1.33:user 1.09:sys 0.19: +20:real 2.74:user 2.38:sys 0.30: +20:real 2.73:user 2.36:sys 0.32: +20:real 2.72:user 2.35:sys 0.32: +20:real 2.76:user 2.40:sys 0.30: +20:real 2.74:user 2.39:sys 0.29: +20:real 2.74:user 2.38:sys 0.31: +20:real 2.75:user 2.36:sys 0.33: +20:real 2.78:user 2.42:sys 0.31: +20:real 2.74:user 2.35:sys 0.34: +20:real 2.75:user 2.41:sys 0.29: +20:real 2.75:user 2.40:sys 0.30: +20:real 2.73:user 2.38:sys 0.31: +20:real 2.79:user 2.41:sys 0.31: +20:real 2.77:user 2.39:sys 0.29: +20:real 2.77:user 2.40:sys 0.32: +20:real 2.76:user 2.41:sys 0.30: +20:real 2.77:user 2.42:sys 0.29: +20:real 2.75:user 2.39:sys 0.31: +20:real 2.74:user 2.39:sys 0.30: +20:real 2.72:user 2.35:sys 0.31: +30:real 5.17:user 4.59:sys 0.53: +30:real 5.17:user 4.56:sys 0.56: +30:real 5.18:user 4.59:sys 0.54: +30:real 5.54:user 4.72:sys 0.76: +30:real 5.02:user 4.43:sys 0.54: +30:real 5.12:user 4.50:sys 0.55: +30:real 5.12:user 4.50:sys 0.57: +30:real 5.68:user 4.62:sys 0.98: +30:real 5.19:user 4.52:sys 0.59: +30:real 5.54:user 4.65:sys 0.82: +30:real 5.13:user 4.50:sys 0.58: +30:real 5.16:user 4.52:sys 0.57: +30:real 5.15:user 4.52:sys 0.57: +30:real 5.25:user 4.60:sys 0.59: +30:real 5.18:user 4.53:sys 0.59: +30:real 5.18:user 4.58:sys 0.55: +30:real 5.18:user 4.58:sys 0.55: +30:real 5.21:user 4.59:sys 0.56: +30:real 5.04:user 4.50:sys 0.49: +30:real 5.16:user 4.55:sys 0.56: +40:real 8.58:user 7.58:sys 0.91: +40:real 8.56:user 7.65:sys 0.86: +40:real 8.52:user 7.65:sys 0.82: +40:real 8.56:user 7.60:sys 0.91: +40:real 8.51:user 7.60:sys 0.86: +40:real 8.55:user 7.61:sys 0.89: +40:real 8.57:user 7.61:sys 0.90: +40:real 9.32:user 8.05:sys 1.21: +40:real 8.55:user 7.62:sys 0.83: +40:real 8.68:user 7.62:sys 1.00: +40:real 8.66:user 7.63:sys 0.96: +40:real 8.60:user 7.66:sys 0.89: +40:real 8.40:user 7.49:sys 0.84: +40:real 9.02:user 7.59:sys 1.35: +40:real 9.34:user 7.96:sys 1.30: +40:real 9.15:user 7.88:sys 1.17: +40:real 9.06:user 7.82:sys 1.16: +40:real 9.46:user 8.09:sys 1.30: +40:real 8.72:user 7.66:sys 0.99: +40:real 8.71:user 7.74:sys 0.91: +50:real 13.87:user 12.38:sys 1.43: +50:real 14.68:user 12.49:sys 2.11: +50:real 13.67:user 12.10:sys 1.49: +50:real 15.10:user 12.88:sys 2.17: +50:real 13.95:user 12.44:sys 1.46: +50:real 14.11:user 12.61:sys 1.43: +50:real 13.93:user 12.47:sys 1.40: +50:real 13.97:user 12.47:sys 1.41: +50:real 13.89:user 12.42:sys 1.42: +50:real 15.20:user 12.88:sys 2.24: +50:real 15.23:user 12.93:sys 2.23: +50:real 13.89:user 12.34:sys 1.47: +50:real 15.02:user 12.71:sys 2.21: +50:real 14.37:user 12.34:sys 1.96: +50:real 14.65:user 12.68:sys 1.90: +50:real 14.37:user 12.47:sys 1.82: +50:real 14.18:user 12.57:sys 1.53: +50:real 14.70:user 12.55:sys 2.04: +50:real 13.93:user 12.40:sys 1.48: +50:real 13.92:user 12.44:sys 1.43: +60:real 23.65:user 20.97:sys 2.62: +60:real 22.12:user 19.89:sys 2.14: +60:real 22.03:user 19.89:sys 2.09: +60:real 22.89:user 20.20:sys 2.60: +60:real 22.16:user 19.77:sys 2.26: +60:real 23.47:user 20.63:sys 2.75: +60:real 23.48:user 20.27:sys 3.12: +60:real 22.84:user 20.28:sys 2.42: +60:real 23.51:user 20.72:sys 2.70: +60:real 23.14:user 20.41:sys 2.63: +60:real 22.64:user 20.21:sys 2.31: +60:real 21.98:user 19.88:sys 2.03: +60:real 22.13:user 19.95:sys 2.13: +60:real 22.17:user 19.95:sys 2.14: +60:real 22.17:user 20.06:sys 2.06: +60:real 22.17:user 19.99:sys 2.11: +60:real 22.27:user 20.15:sys 2.03: +60:real 22.09:user 20.02:sys 2.01: +60:real 22.07:user 19.92:sys 2.09: +60:real 21.53:user 19.36:sys 2.08: +70:real 33.39:user 29.96:sys 3.34: +70:real 33.98:user 29.85:sys 4.04: +70:real 33.48:user 29.51:sys 3.86: +70:real 32.26:user 28.92:sys 3.23: +70:real 34.58:user 30.19:sys 4.27: +70:real 33.90:user 30.06:sys 3.74: +70:real 32.47:user 29.36:sys 3.01: +70:real 34.77:user 31.01:sys 3.69: +70:real 35.85:user 31.26:sys 4.49: +70:real 35.30:user 30.54:sys 4.65: +70:real 33.13:user 29.99:sys 3.02: +70:real 32.61:user 29.47:sys 3.05: +70:real 32.55:user 29.43:sys 2.99: +70:real 36.19:user 31.40:sys 4.68: +70:real 33.88:user 29.85:sys 3.90: +70:real 33.22:user 29.51:sys 3.61: +70:real 32.01:user 28.77:sys 3.12: +70:real 35.67:user 31.20:sys 4.41: +70:real 34.98:user 30.94:sys 3.95: +70:real 34.14:user 30.65:sys 3.41: +80:real 51.63:user 46.25:sys 5.23: +80:real 49.52:user 44.62:sys 4.78: +80:real 49.85:user 44.87:sys 4.82: +80:real 49.83:user 44.79:sys 4.93: +80:real 51.45:user 46.36:sys 4.95: +80:real 50.58:user 45.41:sys 5.04: +80:real 50.57:user 45.54:sys 4.88: +80:real 52.68:user 46.95:sys 5.58: +80:real 50.53:user 45.80:sys 4.58: +80:real 52.15:user 45.95:sys 6.06: +80:real 50.13:user 45.57:sys 4.40: +80:real 50.56:user 46.05:sys 4.38: +80:real 53.88:user 48.08:sys 5.65: +80:real 55.11:user 48.51:sys 6.46: +80:real 55.84:user 48.72:sys 6.95: +80:real 53.83:user 47.94:sys 5.78: +80:real 50.92:user 46.39:sys 4.43: +80:real 52.61:user 46.86:sys 5.65: +80:real 50.63:user 45.62:sys 4.87: +80:real 51.77:user 46.73:sys 4.90: +90:real 76.34:user 69.91:sys 6.23: +90:real 76.69:user 70.29:sys 6.28: +90:real 77.93:user 70.49:sys 7.26: +90:real 75.14:user 69.65:sys 5.36: +90:real 80.60:user 72.33:sys 8.08: +90:real 76.80:user 70.60:sys 6.02: +90:real 76.02:user 68.03:sys 7.80: +90:real 74.09:user 67.43:sys 6.46: +90:real 75.19:user 68.86:sys 6.13: +90:real 76.16:user 69.81:sys 6.15: +90:real 74.95:user 68.69:sys 6.06: +90:real 75.48:user 69.24:sys 6.04: +90:real 75.00:user 68.62:sys 6.18: +90:real 73.61:user 66.97:sys 6.43: +90:real 76.25:user 68.39:sys 7.66: +90:real 74.87:user 67.97:sys 6.69: +90:real 75.48:user 67.80:sys 7.48: +90:real 73.97:user 67.26:sys 6.50: +90:real 76.24:user 68.33:sys 7.72: +90:real 74.44:user 67.85:sys 6.38: diff --git a/results/ct/data/ct_fixedv_indep_fixedi b/results/ct/data/ct_fixedv_indep_fixedi new file mode 100644 index 0000000..27e84ad --- /dev/null +++ b/results/ct/data/ct_fixedv_indep_fixedi @@ -0,0 +1,200 @@ +100:real 254.19:user 243.58:sys 10.36: +100:real 284.13:user 267.73:sys 16.07: +100:real 270.95:user 253.92:sys 16.74: +100:real 286.06:user 270.14:sys 15.62: +100:real 243.78:user 233.49:sys 10.05: +100:real 246.91:user 234.00:sys 12.65: +100:real 246.84:user 236.35:sys 10.23: +100:real 255.70:user 244.64:sys 10.79: +100:real 254.83:user 241.57:sys 12.99: +100:real 248.34:user 237.23:sys 10.87: +100:real 246.96:user 236.22:sys 10.46: +100:real 300.98:user 281.13:sys 19.61: +100:real 286.24:user 274.95:sys 11.09: +100:real 248.49:user 238.08:sys 10.18: +100:real 264.10:user 251.21:sys 12.69: +100:real 257.62:user 247.43:sys 9.92: +100:real 258.53:user 245.76:sys 12.53: +100:real 245.29:user 235.16:sys 9.85: +100:real 272.61:user 259.12:sys 13.18: +100:real 292.90:user 259.10:sys 33.48: +10:real 1.26:user 0.96:sys 0.19: +10:real 1.17:user 0.95:sys 0.17: +10:real 1.16:user 0.91:sys 0.20: +10:real 1.17:user 0.94:sys 0.18: +10:real 1.16:user 0.93:sys 0.16: +10:real 1.11:user 0.90:sys 0.16: +10:real 1.13:user 0.91:sys 0.17: +10:real 1.13:user 0.91:sys 0.17: +10:real 1.17:user 0.94:sys 0.18: +10:real 1.12:user 0.91:sys 0.16: +10:real 1.17:user 0.92:sys 0.20: +10:real 1.21:user 1.00:sys 0.15: +10:real 1.20:user 0.95:sys 0.19: +10:real 1.24:user 1.00:sys 0.17: +10:real 1.16:user 0.94:sys 0.17: +10:real 1.20:user 0.96:sys 0.18: +10:real 1.17:user 0.95:sys 0.18: +10:real 1.19:user 0.97:sys 0.17: +10:real 1.17:user 0.96:sys 0.16: +10:real 1.18:user 0.95:sys 0.18: +20:real 2.24:user 1.90:sys 0.27: +20:real 2.15:user 1.83:sys 0.27: +20:real 2.14:user 1.81:sys 0.27: +20:real 2.12:user 1.79:sys 0.28: +20:real 2.14:user 1.81:sys 0.28: +20:real 2.24:user 1.86:sys 0.32: +20:real 2.14:user 1.81:sys 0.27: +20:real 2.15:user 1.83:sys 0.27: +20:real 2.14:user 1.78:sys 0.29: +20:real 2.10:user 1.80:sys 0.25: +20:real 2.14:user 1.83:sys 0.25: +20:real 2.08:user 1.77:sys 0.26: +20:real 2.12:user 1.78:sys 0.29: +20:real 2.09:user 1.77:sys 0.27: +20:real 2.13:user 1.82:sys 0.26: +20:real 2.11:user 1.79:sys 0.27: +20:real 2.15:user 1.83:sys 0.26: +20:real 2.18:user 1.82:sys 0.28: +20:real 2.09:user 1.77:sys 0.27: +20:real 2.27:user 1.87:sys 0.34: +30:real 3.68:user 3.14:sys 0.49: +30:real 3.70:user 3.19:sys 0.46: +30:real 3.65:user 3.10:sys 0.49: +30:real 3.67:user 3.14:sys 0.48: +30:real 3.67:user 3.14:sys 0.47: +30:real 3.67:user 3.13:sys 0.47: +30:real 3.64:user 3.14:sys 0.45: +30:real 3.77:user 3.19:sys 0.52: +30:real 3.63:user 3.11:sys 0.47: +30:real 3.67:user 3.12:sys 0.49: +30:real 4.17:user 3.27:sys 0.84: +30:real 3.63:user 3.09:sys 0.49: +30:real 3.65:user 3.12:sys 0.47: +30:real 3.67:user 3.09:sys 0.51: +30:real 3.73:user 3.18:sys 0.49: +30:real 3.79:user 3.16:sys 0.52: +30:real 3.67:user 3.13:sys 0.48: +30:real 3.66:user 3.15:sys 0.46: +30:real 3.90:user 3.27:sys 0.57: +30:real 3.64:user 3.12:sys 0.47: +40:real 6.23:user 5.31:sys 0.84: +40:real 6.19:user 5.31:sys 0.82: +40:real 6.68:user 5.43:sys 1.19: +40:real 6.24:user 5.38:sys 0.79: +40:real 6.25:user 5.35:sys 0.85: +40:real 6.51:user 5.47:sys 0.98: +40:real 6.24:user 5.37:sys 0.80: +40:real 6.14:user 5.26:sys 0.78: +40:real 6.17:user 5.37:sys 0.75: +40:real 6.15:user 5.33:sys 0.76: +40:real 6.20:user 5.32:sys 0.83: +40:real 6.17:user 5.32:sys 0.80: +40:real 6.21:user 5.32:sys 0.83: +40:real 6.14:user 5.33:sys 0.76: +40:real 6.15:user 5.30:sys 0.80: +40:real 6.17:user 5.34:sys 0.78: +40:real 6.15:user 5.29:sys 0.80: +40:real 6.20:user 5.29:sys 0.81: +40:real 6.12:user 5.32:sys 0.75: +40:real 6.40:user 5.54:sys 0.80: +50:real 10.27:user 8.88:sys 1.34: +50:real 10.36:user 8.87:sys 1.42: +50:real 10.45:user 9.01:sys 1.37: +50:real 10.43:user 9.00:sys 1.37: +50:real 10.63:user 8.97:sys 1.55: +50:real 10.63:user 9.03:sys 1.53: +50:real 11.29:user 9.33:sys 1.88: +50:real 11.02:user 9.05:sys 1.90: +50:real 10.73:user 9.08:sys 1.58: +50:real 11.58:user 9.48:sys 2.03: +50:real 10.06:user 8.58:sys 1.36: +50:real 10.23:user 8.87:sys 1.29: +50:real 11.65:user 9.46:sys 2.12: +50:real 11.50:user 9.41:sys 2.00: +50:real 11.33:user 9.35:sys 1.90: +50:real 10.33:user 8.80:sys 1.45: +50:real 10.93:user 9.18:sys 1.64: +50:real 11.22:user 9.20:sys 1.95: +50:real 11.43:user 9.41:sys 1.94: +50:real 11.41:user 9.41:sys 1.93: +60:real 17.34:user 14.59:sys 2.66: +60:real 18.84:user 15.43:sys 3.31: +60:real 17.97:user 14.97:sys 2.91: +60:real 17.90:user 15.02:sys 2.81: +60:real 18.07:user 14.96:sys 3.00: +60:real 18.45:user 15.18:sys 3.14: +60:real 19.40:user 16.05:sys 3.28: +60:real 18.59:user 15.31:sys 3.19: +60:real 17.62:user 14.70:sys 2.83: +60:real 17.83:user 14.90:sys 2.83: +60:real 18.09:user 15.27:sys 2.74: +60:real 17.33:user 14.50:sys 2.74: +60:real 17.73:user 14.78:sys 2.86: +60:real 17.87:user 14.98:sys 2.77: +60:real 16.31:user 14.15:sys 2.10: +60:real 17.83:user 15.22:sys 2.56: +60:real 16.50:user 14.20:sys 2.24: +60:real 16.47:user 14.25:sys 2.13: +60:real 16.64:user 14.35:sys 2.23: +60:real 16.55:user 14.21:sys 2.28: +70:real 24.61:user 21.39:sys 3.14: +70:real 24.83:user 21.58:sys 3.13: +70:real 24.81:user 21.60:sys 3.16: +70:real 24.68:user 21.47:sys 3.15: +70:real 24.69:user 21.49:sys 3.11: +70:real 24.66:user 21.57:sys 3.03: +70:real 24.67:user 21.46:sys 3.12: +70:real 26.24:user 22.16:sys 3.96: +70:real 24.58:user 21.33:sys 3.18: +70:real 24.59:user 21.52:sys 3.00: +70:real 24.95:user 21.58:sys 3.28: +70:real 24.82:user 21.59:sys 3.18: +70:real 24.67:user 21.14:sys 3.44: +70:real 24.64:user 21.37:sys 3.16: +70:real 24.65:user 21.41:sys 3.15: +70:real 26.09:user 22.15:sys 3.84: +70:real 24.67:user 21.11:sys 3.43: +70:real 27.89:user 21.67:sys 6.13: +70:real 25.91:user 21.94:sys 3.85: +70:real 24.99:user 21.25:sys 3.62: +80:real 40.29:user 35.39:sys 4.79: +80:real 42.40:user 35.99:sys 6.26: +80:real 43.13:user 37.09:sys 5.92: +80:real 41.31:user 35.83:sys 5.34: +80:real 40.67:user 35.73:sys 4.83: +80:real 40.16:user 35.56:sys 4.49: +80:real 40.55:user 35.70:sys 4.79: +80:real 40.02:user 35.47:sys 4.45: +80:real 40.66:user 35.66:sys 4.93: +80:real 40.53:user 35.55:sys 4.89: +80:real 43.94:user 37.13:sys 6.71: +80:real 41.98:user 35.91:sys 5.93: +80:real 41.69:user 36.01:sys 5.56: +80:real 40.82:user 35.82:sys 4.86: +80:real 40.89:user 35.81:sys 5.00: +80:real 43.04:user 37.23:sys 5.72: +80:real 43.08:user 36.59:sys 6.39: +80:real 45.34:user 37.62:sys 7.57: +80:real 43.28:user 36.46:sys 6.69: +80:real 42.85:user 37.17:sys 5.54: +90:real 78.47:user 71.29:sys 7.04: +90:real 78.37:user 70.68:sys 7.50: +90:real 79.41:user 71.82:sys 7.37: +90:real 78.26:user 70.15:sys 7.91: +90:real 80.67:user 72.79:sys 7.66: +90:real 97.37:user 88.85:sys 8.29: +90:real 78.75:user 71.77:sys 6.85: +90:real 86.47:user 75.94:sys 10.32: +90:real 87.69:user 76.95:sys 10.50: +90:real 83.65:user 74.51:sys 8.91: +90:real 84.21:user 76.04:sys 7.97: +90:real 79.62:user 72.10:sys 7.40: +90:real 84.60:user 75.80:sys 8.57: +90:real 79.53:user 70.83:sys 8.50: +90:real 80.17:user 71.92:sys 8.04: +90:real 78.26:user 70.10:sys 7.96: +90:real 79.06:user 70.54:sys 8.31: +90:real 89.24:user 80.51:sys 8.52: +90:real 78.19:user 71.32:sys 6.74: +90:real 80.64:user 71.30:sys 9.13: diff --git a/results/ct/data/ct_fixedv_indep_randi b/results/ct/data/ct_fixedv_indep_randi new file mode 100644 index 0000000..3beb84a --- /dev/null +++ b/results/ct/data/ct_fixedv_indep_randi @@ -0,0 +1,200 @@ +100:real 308.56:user 297.42:sys 10.84: +100:real 346.85:user 334.50:sys 12.05: +100:real 346.17:user 331.84:sys 14.03: +100:real 300.37:user 289.37:sys 10.74: +100:real 302.70:user 292.22:sys 10.20: +100:real 306.46:user 293.30:sys 12.86: +100:real 301.13:user 289.71:sys 11.14: +100:real 322.75:user 311.50:sys 10.91: +100:real 305.02:user 294.32:sys 10.47: +100:real 363.38:user 348.29:sys 14.74: +100:real 299.31:user 288.46:sys 10.55: +100:real 304.51:user 292.94:sys 11.30: +100:real 308.19:user 294.27:sys 13.61: +100:real 328.06:user 315.68:sys 12.15: +100:real 304.57:user 293.86:sys 10.45: +100:real 302.25:user 291.60:sys 10.38: +100:real 327.20:user 311.47:sys 15.41: +100:real 355.24:user 343.66:sys 11.28: +100:real 311.39:user 300.61:sys 10.50: +100:real 355.02:user 343.64:sys 11.11: +10:real 1.48:user 1.18:sys 0.20: +10:real 1.40:user 1.15:sys 0.20: +10:real 1.43:user 1.18:sys 0.20: +10:real 1.46:user 1.19:sys 0.21: +10:real 1.44:user 1.19:sys 0.19: +10:real 1.43:user 1.17:sys 0.20: +10:real 1.38:user 1.15:sys 0.19: +10:real 1.45:user 1.19:sys 0.20: +10:real 1.41:user 1.19:sys 0.17: +10:real 1.42:user 1.17:sys 0.19: +10:real 1.43:user 1.20:sys 0.17: +10:real 1.42:user 1.17:sys 0.20: +10:real 1.42:user 1.18:sys 0.18: +10:real 1.42:user 1.17:sys 0.20: +10:real 1.42:user 1.17:sys 0.20: +10:real 1.43:user 1.18:sys 0.20: +10:real 1.44:user 1.20:sys 0.19: +10:real 1.44:user 1.20:sys 0.19: +10:real 1.43:user 1.18:sys 0.19: +10:real 1.43:user 1.18:sys 0.19: +20:real 2.81:user 2.45:sys 0.31: +20:real 2.83:user 2.47:sys 0.31: +20:real 2.80:user 2.45:sys 0.31: +20:real 2.82:user 2.48:sys 0.29: +20:real 2.80:user 2.43:sys 0.32: +20:real 2.80:user 2.47:sys 0.28: +20:real 2.82:user 2.44:sys 0.33: +20:real 2.85:user 2.48:sys 0.31: +20:real 2.81:user 2.45:sys 0.31: +20:real 2.82:user 2.46:sys 0.32: +20:real 2.82:user 2.45:sys 0.32: +20:real 2.82:user 2.47:sys 0.29: +20:real 2.85:user 2.44:sys 0.32: +20:real 2.83:user 2.48:sys 0.30: +20:real 2.83:user 2.47:sys 0.31: +20:real 2.82:user 2.48:sys 0.28: +20:real 2.81:user 2.46:sys 0.31: +20:real 2.80:user 2.44:sys 0.32: +20:real 2.83:user 2.45:sys 0.34: +20:real 2.80:user 2.43:sys 0.32: +30:real 4.92:user 4.33:sys 0.53: +30:real 4.84:user 4.27:sys 0.51: +30:real 5.06:user 4.37:sys 0.62: +30:real 4.90:user 4.32:sys 0.53: +30:real 5.03:user 4.40:sys 0.57: +30:real 4.94:user 4.36:sys 0.52: +30:real 5.03:user 4.42:sys 0.55: +30:real 4.97:user 4.34:sys 0.58: +30:real 5.45:user 4.58:sys 0.77: +30:real 4.93:user 4.34:sys 0.54: +30:real 5.04:user 4.38:sys 0.58: +30:real 4.96:user 4.33:sys 0.58: +30:real 5.05:user 4.41:sys 0.57: +30:real 4.93:user 4.28:sys 0.60: +30:real 4.96:user 4.30:sys 0.60: +30:real 4.93:user 4.31:sys 0.57: +30:real 4.99:user 4.34:sys 0.58: +30:real 4.96:user 4.35:sys 0.57: +30:real 5.02:user 4.38:sys 0.58: +30:real 4.99:user 4.43:sys 0.50: +40:real 8.94:user 7.61:sys 1.23: +40:real 8.97:user 7.55:sys 1.35: +40:real 8.47:user 7.42:sys 0.98: +40:real 8.43:user 7.39:sys 0.97: +40:real 8.30:user 7.33:sys 0.92: +40:real 8.16:user 7.20:sys 0.89: +40:real 8.79:user 7.38:sys 1.33: +40:real 8.73:user 7.54:sys 1.09: +40:real 8.81:user 7.49:sys 1.25: +40:real 8.40:user 7.34:sys 1.00: +40:real 8.37:user 7.32:sys 0.98: +40:real 8.33:user 7.36:sys 0.92: +40:real 8.35:user 7.27:sys 1.02: +40:real 8.60:user 7.37:sys 1.16: +40:real 8.89:user 7.53:sys 1.28: +40:real 8.74:user 7.54:sys 1.09: +40:real 9.41:user 7.77:sys 1.57: +40:real 8.28:user 7.27:sys 0.95: +40:real 8.23:user 7.27:sys 0.91: +40:real 8.35:user 7.32:sys 0.97: +50:real 13.12:user 11.24:sys 1.79: +50:real 12.95:user 11.34:sys 1.53: +50:real 13.74:user 11.52:sys 2.12: +50:real 13.27:user 11.34:sys 1.85: +50:real 12.98:user 11.35:sys 1.56: +50:real 13.55:user 11.38:sys 2.10: +50:real 13.14:user 11.24:sys 1.81: +50:real 13.00:user 11.40:sys 1.50: +50:real 13.72:user 11.49:sys 2.16: +50:real 13.13:user 11.29:sys 1.76: +50:real 12.97:user 11.36:sys 1.54: +50:real 13.60:user 11.42:sys 2.10: +50:real 13.22:user 11.29:sys 1.83: +50:real 12.77:user 11.27:sys 1.45: +50:real 12.77:user 11.34:sys 1.38: +50:real 12.79:user 11.33:sys 1.41: +50:real 12.93:user 11.42:sys 1.45: +50:real 12.86:user 11.32:sys 1.46: +50:real 12.75:user 11.30:sys 1.39: +50:real 12.86:user 11.38:sys 1.42: +60:real 21.75:user 18.95:sys 2.71: +60:real 22.30:user 19.24:sys 2.95: +60:real 22.34:user 19.39:sys 2.87: +60:real 20.64:user 18.52:sys 2.03: +60:real 21.24:user 18.78:sys 2.34: +60:real 20.50:user 18.08:sys 2.35: +60:real 20.75:user 18.22:sys 2.44: +60:real 20.40:user 18.16:sys 2.13: +60:real 20.25:user 18.12:sys 2.06: +60:real 20.71:user 18.42:sys 2.23: +60:real 20.83:user 18.51:sys 2.24: +60:real 20.18:user 17.98:sys 2.15: +60:real 20.65:user 18.39:sys 2.20: +60:real 21.67:user 18.94:sys 2.62: +60:real 21.45:user 18.79:sys 2.58: +60:real 21.45:user 18.64:sys 2.72: +60:real 21.12:user 18.70:sys 2.31: +60:real 20.44:user 18.04:sys 2.31: +60:real 20.87:user 18.27:sys 2.52: +60:real 20.17:user 17.91:sys 2.15: +70:real 30.32:user 27.11:sys 3.13: +70:real 29.63:user 26.59:sys 2.96: +70:real 30.78:user 27.33:sys 3.36: +70:real 30.81:user 27.42:sys 3.33: +70:real 32.19:user 28.07:sys 4.02: +70:real 31.33:user 27.51:sys 3.72: +70:real 31.02:user 27.15:sys 3.74: +70:real 31.27:user 27.20:sys 3.97: +70:real 30.69:user 27.20:sys 3.37: +70:real 30.26:user 26.81:sys 3.34: +70:real 30.26:user 26.88:sys 3.25: +70:real 30.35:user 26.75:sys 3.49: +70:real 30.18:user 26.55:sys 3.51: +70:real 30.35:user 26.71:sys 3.55: +70:real 30.19:user 26.43:sys 3.62: +70:real 30.05:user 26.55:sys 3.39: +70:real 30.15:user 26.63:sys 3.39: +70:real 30.07:user 26.57:sys 3.40: +70:real 29.98:user 26.54:sys 3.32: +70:real 30.85:user 27.26:sys 3.48: +80:real 49.44:user 44.72:sys 4.59: +80:real 50.06:user 45.17:sys 4.82: +80:real 49.36:user 44.65:sys 4.58: +80:real 49.74:user 44.91:sys 4.71: +80:real 49.93:user 45.11:sys 4.67: +80:real 49.88:user 45.17:sys 4.59: +80:real 49.87:user 45.06:sys 4.67: +80:real 50.12:user 45.28:sys 4.72: +80:real 50.36:user 45.22:sys 4.98: +80:real 50.36:user 44.98:sys 5.24: +80:real 53.01:user 46.34:sys 6.49: +80:real 52.35:user 45.84:sys 6.37: +80:real 53.01:user 46.77:sys 6.09: +80:real 54.49:user 47.55:sys 6.79: +80:real 50.16:user 45.26:sys 4.80: +80:real 50.37:user 45.38:sys 4.90: +80:real 51.14:user 44.74:sys 6.24: +80:real 50.63:user 44.53:sys 5.96: +80:real 51.37:user 45.38:sys 5.82: +80:real 49.74:user 43.91:sys 5.70: +90:real 112.80:user 102.55:sys 10.01: +90:real 115.99:user 106.86:sys 8.89: +90:real 111.30:user 100.84:sys 10.18: +90:real 109.57:user 95.99:sys 13.33: +90:real 110.48:user 100.63:sys 9.61: +90:real 122.26:user 112.91:sys 9.10: +90:real 103.77:user 95.17:sys 8.39: +90:real 96.86:user 89.26:sys 7.39: +90:real 99.89:user 92.64:sys 7.07: +90:real 99.55:user 91.21:sys 8.14: +90:real 111.42:user 100.99:sys 10.16: +90:real 115.10:user 105.47:sys 9.40: +90:real 103.51:user 95.05:sys 8.32: +90:real 116.22:user 105.66:sys 10.36: +90:real 118.66:user 109.21:sys 9.31: +90:real 103.82:user 94.80:sys 8.81: +90:real 107.56:user 100.07:sys 7.33: +90:real 102.87:user 94.70:sys 8.04: +90:real 107.37:user 98.25:sys 8.88: +90:real 106.49:user 98.10:sys 8.26: diff --git a/results/rt/data_basic/rt_seq_gen_omp b/results/rt/data_basic/rt_seq_gen_omp new file mode 100644 index 0000000..b07850f --- /dev/null +++ b/results/rt/data_basic/rt_seq_gen_omp @@ -0,0 +1,120 @@ +100:gen_omp:0:1:0.000427 +100:gen_omp:0:1:0.000435 +100:gen_omp:0:1:0.000429 +100:gen_omp:0:1:0.000426 +100:gen_omp:0:1:0.000432 +100:gen_omp:0:1:0.000436 +100:gen_omp:0:1:0.000429 +100:gen_omp:0:1:0.000428 +100:gen_omp:0:1:0.000426 +100:gen_omp:0:1:0.000408 +100:gen_omp:0:1:0.000412 +100:gen_omp:0:1:0.000414 +100:gen_omp:0:1:0.000414 +100:gen_omp:0:1:0.000446 +100:gen_omp:0:1:0.000417 +100:gen_omp:0:1:0.000392 +100:gen_omp:0:1:0.000416 +100:gen_omp:0:1:0.000395 +100:gen_omp:0:1:0.000341 +100:gen_omp:0:1:0.000343 +1000:gen_omp:0:1:0.002955 +1000:gen_omp:0:1:0.00295 +1000:gen_omp:0:1:0.002948 +1000:gen_omp:0:1:0.002929 +1000:gen_omp:0:1:0.002938 +1000:gen_omp:0:1:0.002907 +1000:gen_omp:0:1:0.002953 +1000:gen_omp:0:1:0.002952 +1000:gen_omp:0:1:0.002951 +1000:gen_omp:0:1:0.00295 +1000:gen_omp:0:1:0.002952 +1000:gen_omp:0:1:0.002933 +1000:gen_omp:0:1:0.002912 +1000:gen_omp:0:1:0.002939 +1000:gen_omp:0:1:0.00294 +1000:gen_omp:0:1:0.002948 +1000:gen_omp:0:1:0.002942 +1000:gen_omp:0:1:0.002955 +1000:gen_omp:0:1:0.002927 +1000:gen_omp:0:1:0.002953 +10000:gen_omp:0:1:0.028354 +10000:gen_omp:0:1:0.028318 +10000:gen_omp:0:1:0.028235 +10000:gen_omp:0:1:0.028353 +10000:gen_omp:0:1:0.028306 +10000:gen_omp:0:1:0.028394 +10000:gen_omp:0:1:0.028305 +10000:gen_omp:0:1:0.028203 +10000:gen_omp:0:1:0.028165 +10000:gen_omp:0:1:0.028284 +10000:gen_omp:0:1:0.028236 +10000:gen_omp:0:1:0.028244 +10000:gen_omp:0:1:0.028245 +10000:gen_omp:0:1:0.028324 +10000:gen_omp:0:1:0.02847 +10000:gen_omp:0:1:0.028141 +10000:gen_omp:0:1:0.028232 +10000:gen_omp:0:1:0.028314 +10000:gen_omp:0:1:0.02823 +10000:gen_omp:0:1:0.028275 +100000:gen_omp:0:1:0.450409 +100000:gen_omp:0:1:0.443167 +100000:gen_omp:0:1:0.442001 +100000:gen_omp:0:1:0.453455 +100000:gen_omp:0:1:0.453578 +100000:gen_omp:0:1:0.442623 +100000:gen_omp:0:1:0.443893 +100000:gen_omp:0:1:0.442075 +100000:gen_omp:0:1:0.434862 +100000:gen_omp:0:1:0.449875 +100000:gen_omp:0:1:0.436116 +100000:gen_omp:0:1:0.440275 +100000:gen_omp:0:1:0.44918 +100000:gen_omp:0:1:0.440021 +100000:gen_omp:0:1:0.445543 +100000:gen_omp:0:1:0.449671 +100000:gen_omp:0:1:0.438401 +100000:gen_omp:0:1:0.451352 +100000:gen_omp:0:1:0.441231 +100000:gen_omp:0:1:0.451271 +1000000:gen_omp:0:1:4.46412 +1000000:gen_omp:0:1:4.4402 +1000000:gen_omp:0:1:4.41831 +1000000:gen_omp:0:1:4.39515 +1000000:gen_omp:0:1:4.41876 +1000000:gen_omp:0:1:4.45696 +1000000:gen_omp:0:1:4.42537 +1000000:gen_omp:0:1:4.49228 +1000000:gen_omp:0:1:4.47662 +1000000:gen_omp:0:1:4.43187 +1000000:gen_omp:0:1:4.46779 +1000000:gen_omp:0:1:4.43493 +1000000:gen_omp:0:1:4.46829 +1000000:gen_omp:0:1:4.44534 +1000000:gen_omp:0:1:4.48334 +1000000:gen_omp:0:1:4.42231 +1000000:gen_omp:0:1:4.424 +1000000:gen_omp:0:1:4.43739 +1000000:gen_omp:0:1:4.46183 +1000000:gen_omp:0:1:4.45029 +10000000:gen_omp:0:1:51.1169 +10000000:gen_omp:0:1:51.0945 +10000000:gen_omp:0:1:51.1788 +10000000:gen_omp:0:1:51.1402 +10000000:gen_omp:0:1:51.1887 +10000000:gen_omp:0:1:51.0986 +10000000:gen_omp:0:1:51.2076 +10000000:gen_omp:0:1:51.1281 +10000000:gen_omp:0:1:51.1391 +10000000:gen_omp:0:1:51.1819 +10000000:gen_omp:0:1:51.153 +10000000:gen_omp:0:1:51.175 +10000000:gen_omp:0:1:51.163 +10000000:gen_omp:0:1:51.1547 +10000000:gen_omp:0:1:51.1707 +10000000:gen_omp:0:1:50.8792 +10000000:gen_omp:0:1:51.1588 +10000000:gen_omp:0:1:51.1697 +10000000:gen_omp:0:1:51.1975 +10000000:gen_omp:0:1:51.1555 diff --git a/results/rt/data_basic/rt_seq_gen_thread b/results/rt/data_basic/rt_seq_gen_thread new file mode 100644 index 0000000..5d62066 --- /dev/null +++ b/results/rt/data_basic/rt_seq_gen_thread @@ -0,0 +1,120 @@ +100:gen_thread:0:1:0.000394 +100:gen_thread:0:1:0.000392 +100:gen_thread:0:1:0.000395 +100:gen_thread:0:1:0.000391 +100:gen_thread:0:1:0.000396 +100:gen_thread:0:1:0.000391 +100:gen_thread:0:1:0.00039 +100:gen_thread:0:1:0.000403 +100:gen_thread:0:1:0.000393 +100:gen_thread:0:1:0.000392 +100:gen_thread:0:1:0.000407 +100:gen_thread:0:1:0.000404 +100:gen_thread:0:1:0.000402 +100:gen_thread:0:1:0.000402 +100:gen_thread:0:1:0.000297 +100:gen_thread:0:1:0.000298 +100:gen_thread:0:1:0.000307 +100:gen_thread:0:1:0.000299 +100:gen_thread:0:1:0.000302 +100:gen_thread:0:1:0.000312 +1000:gen_thread:0:1:0.002929 +1000:gen_thread:0:1:0.002943 +1000:gen_thread:0:1:0.002863 +1000:gen_thread:0:1:0.002831 +1000:gen_thread:0:1:0.00283 +1000:gen_thread:0:1:0.002894 +1000:gen_thread:0:1:0.002896 +1000:gen_thread:0:1:0.00289 +1000:gen_thread:0:1:0.002913 +1000:gen_thread:0:1:0.00291 +1000:gen_thread:0:1:0.002921 +1000:gen_thread:0:1:0.002912 +1000:gen_thread:0:1:0.002836 +1000:gen_thread:0:1:0.002942 +1000:gen_thread:0:1:0.002858 +1000:gen_thread:0:1:0.002836 +1000:gen_thread:0:1:0.002945 +1000:gen_thread:0:1:0.002865 +1000:gen_thread:0:1:0.002916 +1000:gen_thread:0:1:0.002861 +10000:gen_thread:0:1:0.028342 +10000:gen_thread:0:1:0.028241 +10000:gen_thread:0:1:0.028311 +10000:gen_thread:0:1:0.02846 +10000:gen_thread:0:1:0.028139 +10000:gen_thread:0:1:0.02824 +10000:gen_thread:0:1:0.028308 +10000:gen_thread:0:1:0.028244 +10000:gen_thread:0:1:0.028239 +10000:gen_thread:0:1:0.028261 +10000:gen_thread:0:1:0.028135 +10000:gen_thread:0:1:0.028236 +10000:gen_thread:0:1:0.028242 +10000:gen_thread:0:1:0.028287 +10000:gen_thread:0:1:0.028297 +10000:gen_thread:0:1:0.028441 +10000:gen_thread:0:1:0.028189 +10000:gen_thread:0:1:0.02845 +10000:gen_thread:0:1:0.028484 +10000:gen_thread:0:1:0.028458 +100000:gen_thread:0:1:0.444505 +100000:gen_thread:0:1:0.440334 +100000:gen_thread:0:1:0.445155 +100000:gen_thread:0:1:0.442666 +100000:gen_thread:0:1:0.437641 +100000:gen_thread:0:1:0.438417 +100000:gen_thread:0:1:0.447416 +100000:gen_thread:0:1:0.442382 +100000:gen_thread:0:1:0.44735 +100000:gen_thread:0:1:0.438667 +100000:gen_thread:0:1:0.438098 +100000:gen_thread:0:1:0.446092 +100000:gen_thread:0:1:0.436995 +100000:gen_thread:0:1:0.439775 +100000:gen_thread:0:1:0.439127 +100000:gen_thread:0:1:0.441563 +100000:gen_thread:0:1:0.441381 +100000:gen_thread:0:1:0.44484 +100000:gen_thread:0:1:0.438376 +100000:gen_thread:0:1:0.443273 +1000000:gen_thread:0:1:4.47171 +1000000:gen_thread:0:1:4.45547 +1000000:gen_thread:0:1:4.46564 +1000000:gen_thread:0:1:4.43925 +1000000:gen_thread:0:1:4.38791 +1000000:gen_thread:0:1:4.43617 +1000000:gen_thread:0:1:4.40905 +1000000:gen_thread:0:1:4.44285 +1000000:gen_thread:0:1:4.46301 +1000000:gen_thread:0:1:4.4393 +1000000:gen_thread:0:1:4.44656 +1000000:gen_thread:0:1:4.43744 +1000000:gen_thread:0:1:4.41934 +1000000:gen_thread:0:1:4.43899 +1000000:gen_thread:0:1:4.43974 +1000000:gen_thread:0:1:4.40119 +1000000:gen_thread:0:1:4.44664 +1000000:gen_thread:0:1:4.46293 +1000000:gen_thread:0:1:4.43474 +1000000:gen_thread:0:1:4.46982 +10000000:gen_thread:0:1:51.3291 +10000000:gen_thread:0:1:51.2703 +10000000:gen_thread:0:1:51.3283 +10000000:gen_thread:0:1:51.3051 +10000000:gen_thread:0:1:51.3105 +10000000:gen_thread:0:1:51.3646 +10000000:gen_thread:0:1:51.379 +10000000:gen_thread:0:1:51.3216 +10000000:gen_thread:0:1:51.2945 +10000000:gen_thread:0:1:51.3481 +10000000:gen_thread:0:1:51.2353 +10000000:gen_thread:0:1:51.2902 +10000000:gen_thread:0:1:51.2597 +10000000:gen_thread:0:1:51.2482 +10000000:gen_thread:0:1:51.2768 +10000000:gen_thread:0:1:51.2602 +10000000:gen_thread:0:1:51.2952 +10000000:gen_thread:0:1:51.3053 +10000000:gen_thread:0:1:51.2716 +10000000:gen_thread:0:1:51.2722 diff --git a/results/rt/data_basic/rt_seq_omp b/results/rt/data_basic/rt_seq_omp new file mode 100644 index 0000000..837091e --- /dev/null +++ b/results/rt/data_basic/rt_seq_omp @@ -0,0 +1,120 @@ +100:omp:0:1: +100:omp:0:1: +100:omp:0:1: +100:omp:0:1: +100:omp:0:1: +100:omp:0:1: +100:omp:0:1: +100:omp:0:1: +100:omp:0:1: +100:omp:0:1: +100:omp:0:1: +100:omp:0:1: +100:omp:0:1: +100:omp:0:1: +100:omp:0:1: +100:omp:0:1: +100:omp:0:1: +100:omp:0:1: +100:omp:0:1: +100:omp:0:1: +1000:omp:0:1: +1000:omp:0:1: +1000:omp:0:1: +1000:omp:0:1: +1000:omp:0:1: +1000:omp:0:1: +1000:omp:0:1: +1000:omp:0:1: +1000:omp:0:1: +1000:omp:0:1: +1000:omp:0:1: +1000:omp:0:1: +1000:omp:0:1: +1000:omp:0:1: +1000:omp:0:1: +1000:omp:0:1: +1000:omp:0:1: +1000:omp:0:1: +1000:omp:0:1: +1000:omp:0:1: +10000:omp:0:1: +10000:omp:0:1: +10000:omp:0:1: +10000:omp:0:1: +10000:omp:0:1: +10000:omp:0:1: +10000:omp:0:1: +10000:omp:0:1: +10000:omp:0:1: +10000:omp:0:1: +10000:omp:0:1: +10000:omp:0:1: +10000:omp:0:1: +10000:omp:0:1: +10000:omp:0:1: +10000:omp:0:1: +10000:omp:0:1: +10000:omp:0:1: +10000:omp:0:1: +10000:omp:0:1: +100000:omp:0:1: +100000:omp:0:1: +100000:omp:0:1: +100000:omp:0:1: +100000:omp:0:1: +100000:omp:0:1: +100000:omp:0:1: +100000:omp:0:1: +100000:omp:0:1: +100000:omp:0:1: +100000:omp:0:1: +100000:omp:0:1: +100000:omp:0:1: +100000:omp:0:1: +100000:omp:0:1: +100000:omp:0:1: +100000:omp:0:1: +100000:omp:0:1: +100000:omp:0:1: +100000:omp:0:1: +1000000:omp:0:1: +1000000:omp:0:1: +1000000:omp:0:1: +1000000:omp:0:1: +1000000:omp:0:1: +1000000:omp:0:1: +1000000:omp:0:1: +1000000:omp:0:1: +1000000:omp:0:1: +1000000:omp:0:1: +1000000:omp:0:1: +1000000:omp:0:1: +1000000:omp:0:1: +1000000:omp:0:1: +1000000:omp:0:1: +1000000:omp:0:1: +1000000:omp:0:1: +1000000:omp:0:1: +1000000:omp:0:1: +1000000:omp:0:1: +10000000:omp:0:1: +10000000:omp:0:1: +10000000:omp:0:1: +10000000:omp:0:1: +10000000:omp:0:1: +10000000:omp:0:1: +10000000:omp:0:1: +10000000:omp:0:1: +10000000:omp:0:1: +10000000:omp:0:1: +10000000:omp:0:1: +10000000:omp:0:1: +10000000:omp:0:1: +10000000:omp:0:1: +10000000:omp:0:1: +10000000:omp:0:1: +10000000:omp:0:1: +10000000:omp:0:1: +10000000:omp:0:1: +10000000:omp:0:1: diff --git a/results/rt/data_basic/rt_seq_seq b/results/rt/data_basic/rt_seq_seq new file mode 100644 index 0000000..4ed602a --- /dev/null +++ b/results/rt/data_basic/rt_seq_seq @@ -0,0 +1,120 @@ +100:seq:0:1:0.000702 +100:seq:0:1:0.000648 +100:seq:0:1:0.000605 +100:seq:0:1:0.000607 +100:seq:0:1:0.000605 +100:seq:0:1:0.000565 +100:seq:0:1:0.000553 +100:seq:0:1:0.000531 +100:seq:0:1:0.000496 +100:seq:0:1:0.000498 +100:seq:0:1:0.000488 +100:seq:0:1:0.000489 +100:seq:0:1:0.000488 +100:seq:0:1:0.000489 +100:seq:0:1:0.000498 +100:seq:0:1:0.000501 +100:seq:0:1:0.000499 +100:seq:0:1:0.000489 +100:seq:0:1:0.000488 +100:seq:0:1:0.000499 +1000:seq:0:1:0.004884 +1000:seq:0:1:0.004593 +1000:seq:0:1:0.004592 +1000:seq:0:1:0.004609 +1000:seq:0:1:0.00461 +1000:seq:0:1:0.00461 +1000:seq:0:1:0.004368 +1000:seq:0:1:0.004374 +1000:seq:0:1:0.004126 +1000:seq:0:1:0.003942 +1000:seq:0:1:0.003935 +1000:seq:0:1:0.003939 +1000:seq:0:1:0.003938 +1000:seq:0:1:0.00394 +1000:seq:0:1:0.003947 +1000:seq:0:1:0.003931 +1000:seq:0:1:0.00394 +1000:seq:0:1:0.00394 +1000:seq:0:1:0.003756 +1000:seq:0:1:0.003602 +10000:seq:0:1:0.035517 +10000:seq:0:1:0.030188 +10000:seq:0:1:0.025547 +10000:seq:0:1:0.025902 +10000:seq:0:1:0.025784 +10000:seq:0:1:0.025808 +10000:seq:0:1:0.025881 +10000:seq:0:1:0.025648 +10000:seq:0:1:0.025686 +10000:seq:0:1:0.025715 +10000:seq:0:1:0.025777 +10000:seq:0:1:0.025904 +10000:seq:0:1:0.025875 +10000:seq:0:1:0.0258 +10000:seq:0:1:0.025714 +10000:seq:0:1:0.026042 +10000:seq:0:1:0.025745 +10000:seq:0:1:0.02583 +10000:seq:0:1:0.025738 +10000:seq:0:1:0.025787 +100000:seq:0:1:0.42954 +100000:seq:0:1:0.411981 +100000:seq:0:1:0.407748 +100000:seq:0:1:0.40925 +100000:seq:0:1:0.407506 +100000:seq:0:1:0.412128 +100000:seq:0:1:0.397342 +100000:seq:0:1:0.422122 +100000:seq:0:1:0.410631 +100000:seq:0:1:0.431113 +100000:seq:0:1:0.413188 +100000:seq:0:1:0.43012 +100000:seq:0:1:0.409255 +100000:seq:0:1:0.42213 +100000:seq:0:1:0.420968 +100000:seq:0:1:0.424702 +100000:seq:0:1:0.399985 +100000:seq:0:1:0.418013 +100000:seq:0:1:0.407299 +100000:seq:0:1:0.397699 +1000000:seq:0:1:4.16503 +1000000:seq:0:1:4.13727 +1000000:seq:0:1:4.13267 +1000000:seq:0:1:4.11734 +1000000:seq:0:1:4.13344 +1000000:seq:0:1:4.12705 +1000000:seq:0:1:4.13222 +1000000:seq:0:1:4.09604 +1000000:seq:0:1:4.10825 +1000000:seq:0:1:4.14909 +1000000:seq:0:1:4.11692 +1000000:seq:0:1:4.1556 +1000000:seq:0:1:4.09616 +1000000:seq:0:1:4.1229 +1000000:seq:0:1:4.08094 +1000000:seq:0:1:4.12582 +1000000:seq:0:1:4.10664 +1000000:seq:0:1:4.08565 +1000000:seq:0:1:4.07787 +1000000:seq:0:1:4.1123 +10000000:seq:0:1:47.6512 +10000000:seq:0:1:47.7135 +10000000:seq:0:1:47.7124 +10000000:seq:0:1:47.7084 +10000000:seq:0:1:47.6651 +10000000:seq:0:1:47.7006 +10000000:seq:0:1:47.6995 +10000000:seq:0:1:47.7261 +10000000:seq:0:1:47.6755 +10000000:seq:0:1:47.6941 +10000000:seq:0:1:47.7087 +10000000:seq:0:1:47.6559 +10000000:seq:0:1:47.7254 +10000000:seq:0:1:47.7034 +10000000:seq:0:1:47.7224 +10000000:seq:0:1:47.6909 +10000000:seq:0:1:47.6694 +10000000:seq:0:1:47.7375 +10000000:seq:0:1:47.7193 +10000000:seq:0:1:47.6518 diff --git a/results/rt/data_basic/rt_size_10_gen_omp b/results/rt/data_basic/rt_size_10_gen_omp new file mode 100644 index 0000000..d4dc238 --- /dev/null +++ b/results/rt/data_basic/rt_size_10_gen_omp @@ -0,0 +1,120 @@ +100:gen_omp:1:10:0.101087 +100:gen_omp:1:10:0.097169 +100:gen_omp:1:10:0.098206 +100:gen_omp:1:10:0.114494 +100:gen_omp:1:10:0.108025 +100:gen_omp:1:10:0.094104 +100:gen_omp:1:10:0.094741 +100:gen_omp:1:10:0.096361 +100:gen_omp:1:10:0.115469 +100:gen_omp:1:10:0.093199 +100:gen_omp:1:10:0.100274 +100:gen_omp:1:10:0.086921 +100:gen_omp:1:10:0.10751 +100:gen_omp:1:10:0.110748 +100:gen_omp:1:10:0.100916 +100:gen_omp:1:10:0.099583 +100:gen_omp:1:10:0.089324 +100:gen_omp:1:10:0.121943 +100:gen_omp:1:10:0.110185 +100:gen_omp:1:10:0.098391 +1000:gen_omp:1:10:0.097776 +1000:gen_omp:1:10:0.150863 +1000:gen_omp:1:10:0.096421 +1000:gen_omp:1:10:0.119838 +1000:gen_omp:1:10:0.096549 +1000:gen_omp:1:10:0.113192 +1000:gen_omp:1:10:0.12406 +1000:gen_omp:1:10:0.112196 +1000:gen_omp:1:10:0.130762 +1000:gen_omp:1:10:0.116279 +1000:gen_omp:1:10:0.113826 +1000:gen_omp:1:10:0.137259 +1000:gen_omp:1:10:0.1619 +1000:gen_omp:1:10:0.12076 +1000:gen_omp:1:10:0.124704 +1000:gen_omp:1:10:0.094925 +1000:gen_omp:1:10:0.129562 +1000:gen_omp:1:10:0.098702 +1000:gen_omp:1:10:0.112263 +1000:gen_omp:1:10:0.097239 +10000:gen_omp:1:10:0.25413 +10000:gen_omp:1:10:0.22921 +10000:gen_omp:1:10:0.238288 +10000:gen_omp:1:10:0.297489 +10000:gen_omp:1:10:0.270222 +10000:gen_omp:1:10:0.283275 +10000:gen_omp:1:10:0.24779 +10000:gen_omp:1:10:0.244005 +10000:gen_omp:1:10:0.305033 +10000:gen_omp:1:10:0.281762 +10000:gen_omp:1:10:0.303371 +10000:gen_omp:1:10:0.290533 +10000:gen_omp:1:10:0.257339 +10000:gen_omp:1:10:0.254889 +10000:gen_omp:1:10:0.301489 +10000:gen_omp:1:10:0.241152 +10000:gen_omp:1:10:0.273733 +10000:gen_omp:1:10:0.290319 +10000:gen_omp:1:10:0.275278 +10000:gen_omp:1:10:0.246936 +100000:gen_omp:1:10:1.59966 +100000:gen_omp:1:10:1.76675 +100000:gen_omp:1:10:1.67897 +100000:gen_omp:1:10:1.71723 +100000:gen_omp:1:10:1.74277 +100000:gen_omp:1:10:1.49571 +100000:gen_omp:1:10:1.75609 +100000:gen_omp:1:10:1.73858 +100000:gen_omp:1:10:1.70807 +100000:gen_omp:1:10:1.58917 +100000:gen_omp:1:10:1.43222 +100000:gen_omp:1:10:1.75186 +100000:gen_omp:1:10:1.73095 +100000:gen_omp:1:10:1.74668 +100000:gen_omp:1:10:1.20267 +100000:gen_omp:1:10:1.65562 +100000:gen_omp:1:10:1.70633 +100000:gen_omp:1:10:1.62153 +100000:gen_omp:1:10:1.61186 +100000:gen_omp:1:10:1.56865 +1000000:gen_omp:1:10:7.25802 +1000000:gen_omp:1:10:6.85848 +1000000:gen_omp:1:10:6.73594 +1000000:gen_omp:1:10:6.73132 +1000000:gen_omp:1:10:6.72312 +1000000:gen_omp:1:10:6.93703 +1000000:gen_omp:1:10:6.70742 +1000000:gen_omp:1:10:7.01789 +1000000:gen_omp:1:10:6.73248 +1000000:gen_omp:1:10:6.79275 +1000000:gen_omp:1:10:6.94227 +1000000:gen_omp:1:10:6.90957 +1000000:gen_omp:1:10:7.03512 +1000000:gen_omp:1:10:6.85644 +1000000:gen_omp:1:10:6.78067 +1000000:gen_omp:1:10:6.61205 +1000000:gen_omp:1:10:6.91761 +1000000:gen_omp:1:10:6.96209 +1000000:gen_omp:1:10:6.81793 +1000000:gen_omp:1:10:6.83243 +10000000:gen_omp:1:10:71.8134 +10000000:gen_omp:1:10:70.9502 +10000000:gen_omp:1:10:71.5539 +10000000:gen_omp:1:10:71.9385 +10000000:gen_omp:1:10:71.3884 +10000000:gen_omp:1:10:70.8512 +10000000:gen_omp:1:10:71.3579 +10000000:gen_omp:1:10:71.7588 +10000000:gen_omp:1:10:70.6748 +10000000:gen_omp:1:10:70.6236 +10000000:gen_omp:1:10:70.9127 +10000000:gen_omp:1:10:71.0622 +10000000:gen_omp:1:10:70.5393 +10000000:gen_omp:1:10:71.2986 +10000000:gen_omp:1:10:71.4571 +10000000:gen_omp:1:10:71.7149 +10000000:gen_omp:1:10:72.0044 +10000000:gen_omp:1:10:71.2259 +10000000:gen_omp:1:10:71.0754 +10000000:gen_omp:1:10:71.0774 diff --git a/results/rt/data_basic/rt_size_10_gen_thread b/results/rt/data_basic/rt_size_10_gen_thread new file mode 100644 index 0000000..e27981e --- /dev/null +++ b/results/rt/data_basic/rt_size_10_gen_thread @@ -0,0 +1,120 @@ +100:gen_thread:1:10:0.489089 +100:gen_thread:1:10:0.484901 +100:gen_thread:1:10:0.449464 +100:gen_thread:1:10:0.515881 +100:gen_thread:1:10:0.539096 +100:gen_thread:1:10:0.492682 +100:gen_thread:1:10:0.50523 +100:gen_thread:1:10:0.502221 +100:gen_thread:1:10:0.494532 +100:gen_thread:1:10:0.544472 +100:gen_thread:1:10:0.55195 +100:gen_thread:1:10:0.510672 +100:gen_thread:1:10:0.541785 +100:gen_thread:1:10:0.529818 +100:gen_thread:1:10:0.526917 +100:gen_thread:1:10:0.468789 +100:gen_thread:1:10:0.533998 +100:gen_thread:1:10:0.522947 +100:gen_thread:1:10:1.14107 +100:gen_thread:1:10:0.530152 +1000:gen_thread:1:10:0.497265 +1000:gen_thread:1:10:0.482318 +1000:gen_thread:1:10:0.519917 +1000:gen_thread:1:10:0.514017 +1000:gen_thread:1:10:0.530782 +1000:gen_thread:1:10:0.449165 +1000:gen_thread:1:10:0.503439 +1000:gen_thread:1:10:1.17057 +1000:gen_thread:1:10:0.516961 +1000:gen_thread:1:10:0.473196 +1000:gen_thread:1:10:0.51244 +1000:gen_thread:1:10:0.533413 +1000:gen_thread:1:10:0.564223 +1000:gen_thread:1:10:0.493889 +1000:gen_thread:1:10:0.547933 +1000:gen_thread:1:10:0.550728 +1000:gen_thread:1:10:0.542859 +1000:gen_thread:1:10:0.495814 +1000:gen_thread:1:10:0.464803 +1000:gen_thread:1:10:0.482201 +10000:gen_thread:1:10:0.559238 +10000:gen_thread:1:10:0.53914 +10000:gen_thread:1:10:0.593385 +10000:gen_thread:1:10:0.619706 +10000:gen_thread:1:10:0.561478 +10000:gen_thread:1:10:0.567449 +10000:gen_thread:1:10:0.534928 +10000:gen_thread:1:10:0.530396 +10000:gen_thread:1:10:0.575169 +10000:gen_thread:1:10:0.591193 +10000:gen_thread:1:10:0.532356 +10000:gen_thread:1:10:0.578627 +10000:gen_thread:1:10:0.589939 +10000:gen_thread:1:10:0.577829 +10000:gen_thread:1:10:0.56926 +10000:gen_thread:1:10:0.570638 +10000:gen_thread:1:10:0.537038 +10000:gen_thread:1:10:0.554792 +10000:gen_thread:1:10:0.541288 +10000:gen_thread:1:10:0.536449 +100000:gen_thread:1:10:1.5212 +100000:gen_thread:1:10:1.49002 +100000:gen_thread:1:10:1.89255 +100000:gen_thread:1:10:2.12619 +100000:gen_thread:1:10:2.07761 +100000:gen_thread:1:10:2.11441 +100000:gen_thread:1:10:2.06008 +100000:gen_thread:1:10:2.07424 +100000:gen_thread:1:10:3.12799 +100000:gen_thread:1:10:2.13574 +100000:gen_thread:1:10:2.20042 +100000:gen_thread:1:10:1.99072 +100000:gen_thread:1:10:1.66163 +100000:gen_thread:1:10:1.61192 +100000:gen_thread:1:10:1.63037 +100000:gen_thread:1:10:1.5852 +100000:gen_thread:1:10:1.59292 +100000:gen_thread:1:10:1.63487 +100000:gen_thread:1:10:1.58322 +100000:gen_thread:1:10:1.59908 +1000000:gen_thread:1:10:7.27886 +1000000:gen_thread:1:10:7.13648 +1000000:gen_thread:1:10:7.17099 +1000000:gen_thread:1:10:7.16655 +1000000:gen_thread:1:10:7.15417 +1000000:gen_thread:1:10:7.27603 +1000000:gen_thread:1:10:7.03377 +1000000:gen_thread:1:10:7.25692 +1000000:gen_thread:1:10:7.05626 +1000000:gen_thread:1:10:7.18631 +1000000:gen_thread:1:10:7.06993 +1000000:gen_thread:1:10:7.02751 +1000000:gen_thread:1:10:7.62993 +1000000:gen_thread:1:10:7.16282 +1000000:gen_thread:1:10:7.1116 +1000000:gen_thread:1:10:7.09249 +1000000:gen_thread:1:10:7.27663 +1000000:gen_thread:1:10:7.27536 +1000000:gen_thread:1:10:7.06554 +1000000:gen_thread:1:10:7.16305 +10000000:gen_thread:1:10:92.5227 +10000000:gen_thread:1:10:91.7013 +10000000:gen_thread:1:10:90.4521 +10000000:gen_thread:1:10:92.8809 +10000000:gen_thread:1:10:97.4181 +10000000:gen_thread:1:10:93.735 +10000000:gen_thread:1:10:90.9324 +10000000:gen_thread:1:10:90.3289 +10000000:gen_thread:1:10:92.9111 +10000000:gen_thread:1:10:93.702 +10000000:gen_thread:1:10:94.7342 +10000000:gen_thread:1:10:94.041 +10000000:gen_thread:1:10:93.3382 +10000000:gen_thread:1:10:93.77 +10000000:gen_thread:1:10:94.0286 +10000000:gen_thread:1:10:92.2787 +10000000:gen_thread:1:10:92.3129 +10000000:gen_thread:1:10:94.2986 +10000000:gen_thread:1:10:94.0799 +10000000:gen_thread:1:10:91.896 diff --git a/results/rt/data_basic/rt_size_10_omp b/results/rt/data_basic/rt_size_10_omp new file mode 100644 index 0000000..03d4d15 --- /dev/null +++ b/results/rt/data_basic/rt_size_10_omp @@ -0,0 +1,120 @@ +100:omp:1:10:0.158905 +100:omp:1:10:0.136951 +100:omp:1:10:0.154255 +100:omp:1:10:0.111766 +100:omp:1:10:0.134443 +100:omp:1:10:0.143829 +100:omp:1:10:0.155767 +100:omp:1:10:0.160847 +100:omp:1:10:0.125402 +100:omp:1:10:0.148734 +100:omp:1:10:0.135119 +100:omp:1:10:0.166325 +100:omp:1:10:0.162321 +100:omp:1:10:0.139923 +100:omp:1:10:0.16608 +100:omp:1:10:0.15741 +100:omp:1:10:0.144954 +100:omp:1:10:0.159703 +100:omp:1:10:0.153871 +100:omp:1:10:0.141928 +1000:omp:1:10:0.168716 +1000:omp:1:10:0.173695 +1000:omp:1:10:0.173735 +1000:omp:1:10:0.152238 +1000:omp:1:10:0.158262 +1000:omp:1:10:0.155191 +1000:omp:1:10:0.180065 +1000:omp:1:10:0.16778 +1000:omp:1:10:0.185061 +1000:omp:1:10:0.150515 +1000:omp:1:10:0.16743 +1000:omp:1:10:0.175217 +1000:omp:1:10:0.168251 +1000:omp:1:10:0.17887 +1000:omp:1:10:0.178586 +1000:omp:1:10:0.173903 +1000:omp:1:10:0.165346 +1000:omp:1:10:0.161748 +1000:omp:1:10:0.139028 +1000:omp:1:10:0.164147 +10000:omp:1:10:0.237816 +10000:omp:1:10:0.224596 +10000:omp:1:10:0.252579 +10000:omp:1:10:0.201322 +10000:omp:1:10:0.251783 +10000:omp:1:10:0.189829 +10000:omp:1:10:0.23826 +10000:omp:1:10:0.244165 +10000:omp:1:10:0.265836 +10000:omp:1:10:0.233283 +10000:omp:1:10:0.243966 +10000:omp:1:10:0.23483 +10000:omp:1:10:0.231675 +10000:omp:1:10:0.232354 +10000:omp:1:10:0.21356 +10000:omp:1:10:0.245255 +10000:omp:1:10:0.197557 +10000:omp:1:10:0.187149 +10000:omp:1:10:0.185527 +10000:omp:1:10:0.265473 +100000:omp:1:10:1.49216 +100000:omp:1:10:1.56037 +100000:omp:1:10:1.53133 +100000:omp:1:10:1.40416 +100000:omp:1:10:1.51749 +100000:omp:1:10:1.59062 +100000:omp:1:10:1.49971 +100000:omp:1:10:1.52968 +100000:omp:1:10:1.4093 +100000:omp:1:10:1.52417 +100000:omp:1:10:1.52609 +100000:omp:1:10:1.59142 +100000:omp:1:10:1.52817 +100000:omp:1:10:1.40419 +100000:omp:1:10:1.56707 +100000:omp:1:10:1.52699 +100000:omp:1:10:1.58163 +100000:omp:1:10:1.57227 +100000:omp:1:10:1.09436 +100000:omp:1:10:1.4161 +1000000:omp:1:10:6.49022 +1000000:omp:1:10:6.49684 +1000000:omp:1:10:6.19211 +1000000:omp:1:10:6.2164 +1000000:omp:1:10:6.0142 +1000000:omp:1:10:6.29032 +1000000:omp:1:10:6.05554 +1000000:omp:1:10:6.30564 +1000000:omp:1:10:6.02582 +1000000:omp:1:10:6.18334 +1000000:omp:1:10:6.12462 +1000000:omp:1:10:6.331 +1000000:omp:1:10:6.54554 +1000000:omp:1:10:6.27763 +1000000:omp:1:10:6.42946 +1000000:omp:1:10:6.32297 +1000000:omp:1:10:6.18228 +1000000:omp:1:10:6.21694 +1000000:omp:1:10:6.07796 +1000000:omp:1:10:6.25706 +10000000:omp:1:10:65.8798 +10000000:omp:1:10:65.9703 +10000000:omp:1:10:65.9784 +10000000:omp:1:10:66.172 +10000000:omp:1:10:66.0777 +10000000:omp:1:10:65.9703 +10000000:omp:1:10:65.5313 +10000000:omp:1:10:65.2976 +10000000:omp:1:10:66.1993 +10000000:omp:1:10:66.1376 +10000000:omp:1:10:65.9767 +10000000:omp:1:10:65.4646 +10000000:omp:1:10:65.9091 +10000000:omp:1:10:66.1048 +10000000:omp:1:10:65.8718 +10000000:omp:1:10:66.1431 +10000000:omp:1:10:65.4355 +10000000:omp:1:10:66.2333 +10000000:omp:1:10:66.1947 +10000000:omp:1:10:65.5948 diff --git a/results/rt/data_basic/rt_size_10_seq b/results/rt/data_basic/rt_size_10_seq new file mode 100644 index 0000000..dce57f9 --- /dev/null +++ b/results/rt/data_basic/rt_size_10_seq @@ -0,0 +1,120 @@ +100:seq:1:10:0.000253 +100:seq:1:10:0.000253 +100:seq:1:10:0.000254 +100:seq:1:10:0.000253 +100:seq:1:10:0.000254 +100:seq:1:10:0.000252 +100:seq:1:10:0.000282 +100:seq:1:10:0.000254 +100:seq:1:10:0.000254 +100:seq:1:10:0.000259 +100:seq:1:10:0.000252 +100:seq:1:10:0.000252 +100:seq:1:10:0.000272 +100:seq:1:10:0.000253 +100:seq:1:10:0.000253 +100:seq:1:10:0.000255 +100:seq:1:10:0.00025 +100:seq:1:10:0.00026 +100:seq:1:10:0.000255 +100:seq:1:10:0.000282 +1000:seq:1:10:0.002481 +1000:seq:1:10:0.002482 +1000:seq:1:10:0.002483 +1000:seq:1:10:0.002485 +1000:seq:1:10:0.002534 +1000:seq:1:10:0.002496 +1000:seq:1:10:0.002491 +1000:seq:1:10:0.002486 +1000:seq:1:10:0.002538 +1000:seq:1:10:0.002482 +1000:seq:1:10:0.002495 +1000:seq:1:10:0.002566 +1000:seq:1:10:0.00248 +1000:seq:1:10:0.002552 +1000:seq:1:10:0.002538 +1000:seq:1:10:0.002495 +1000:seq:1:10:0.002494 +1000:seq:1:10:0.002494 +1000:seq:1:10:0.002544 +1000:seq:1:10:0.002491 +10000:seq:1:10:0.025741 +10000:seq:1:10:0.025448 +10000:seq:1:10:0.025587 +10000:seq:1:10:0.025438 +10000:seq:1:10:0.02532 +10000:seq:1:10:0.025321 +10000:seq:1:10:0.025352 +10000:seq:1:10:0.025439 +10000:seq:1:10:0.025375 +10000:seq:1:10:0.025426 +10000:seq:1:10:0.025383 +10000:seq:1:10:0.025398 +10000:seq:1:10:0.025278 +10000:seq:1:10:0.025359 +10000:seq:1:10:0.025319 +10000:seq:1:10:0.025369 +10000:seq:1:10:0.025595 +10000:seq:1:10:0.025467 +10000:seq:1:10:0.025426 +10000:seq:1:10:0.025325 +100000:seq:1:10:0.538642 +100000:seq:1:10:0.545321 +100000:seq:1:10:0.53512 +100000:seq:1:10:0.541581 +100000:seq:1:10:0.541075 +100000:seq:1:10:0.541886 +100000:seq:1:10:0.540317 +100000:seq:1:10:0.536628 +100000:seq:1:10:0.538018 +100000:seq:1:10:0.534953 +100000:seq:1:10:0.53938 +100000:seq:1:10:0.538569 +100000:seq:1:10:0.534336 +100000:seq:1:10:0.535816 +100000:seq:1:10:0.541159 +100000:seq:1:10:0.533009 +100000:seq:1:10:0.537458 +100000:seq:1:10:0.541901 +100000:seq:1:10:0.544131 +100000:seq:1:10:0.536591 +1000000:seq:1:10:5.40183 +1000000:seq:1:10:5.39608 +1000000:seq:1:10:5.3909 +1000000:seq:1:10:5.39215 +1000000:seq:1:10:5.40603 +1000000:seq:1:10:5.39352 +1000000:seq:1:10:5.41024 +1000000:seq:1:10:5.39501 +1000000:seq:1:10:5.36135 +1000000:seq:1:10:5.38862 +1000000:seq:1:10:5.38217 +1000000:seq:1:10:5.43014 +1000000:seq:1:10:5.38762 +1000000:seq:1:10:5.40282 +1000000:seq:1:10:5.38183 +1000000:seq:1:10:5.37998 +1000000:seq:1:10:5.38825 +1000000:seq:1:10:5.36187 +1000000:seq:1:10:5.40956 +1000000:seq:1:10:5.35818 +10000000:seq:1:10:61.366 +10000000:seq:1:10:61.2606 +10000000:seq:1:10:61.3849 +10000000:seq:1:10:61.3032 +10000000:seq:1:10:61.3986 +10000000:seq:1:10:61.2127 +10000000:seq:1:10:61.3154 +10000000:seq:1:10:61.2465 +10000000:seq:1:10:61.3881 +10000000:seq:1:10:61.231 +10000000:seq:1:10:61.3282 +10000000:seq:1:10:61.2662 +10000000:seq:1:10:61.3281 +10000000:seq:1:10:61.245 +10000000:seq:1:10:61.2781 +10000000:seq:1:10:61.1872 +10000000:seq:1:10:61.2639 +10000000:seq:1:10:61.1967 +10000000:seq:1:10:61.3175 +10000000:seq:1:10:61.2251 diff --git a/results/rt/data_basic/rt_size_12_gen_omp b/results/rt/data_basic/rt_size_12_gen_omp new file mode 100644 index 0000000..3822ced --- /dev/null +++ b/results/rt/data_basic/rt_size_12_gen_omp @@ -0,0 +1,120 @@ +100:gen_omp:1:12:0.116935 +100:gen_omp:1:12:0.120728 +100:gen_omp:1:12:0.106086 +100:gen_omp:1:12:0.136185 +100:gen_omp:1:12:0.123286 +100:gen_omp:1:12:0.162699 +100:gen_omp:1:12:0.117515 +100:gen_omp:1:12:0.150987 +100:gen_omp:1:12:0.189968 +100:gen_omp:1:12:0.176255 +100:gen_omp:1:12:0.16985 +100:gen_omp:1:12:0.158726 +100:gen_omp:1:12:0.163695 +100:gen_omp:1:12:0.155006 +100:gen_omp:1:12:0.165388 +100:gen_omp:1:12:0.157282 +100:gen_omp:1:12:0.169109 +100:gen_omp:1:12:0.172177 +100:gen_omp:1:12:0.162793 +100:gen_omp:1:12:0.127524 +1000:gen_omp:1:12:0.194659 +1000:gen_omp:1:12:0.169375 +1000:gen_omp:1:12:0.139233 +1000:gen_omp:1:12:0.200703 +1000:gen_omp:1:12:0.14836 +1000:gen_omp:1:12:0.179403 +1000:gen_omp:1:12:0.195429 +1000:gen_omp:1:12:0.196142 +1000:gen_omp:1:12:0.15725 +1000:gen_omp:1:12:0.158479 +1000:gen_omp:1:12:0.211059 +1000:gen_omp:1:12:0.163785 +1000:gen_omp:1:12:0.205301 +1000:gen_omp:1:12:0.171569 +1000:gen_omp:1:12:0.212169 +1000:gen_omp:1:12:0.198266 +1000:gen_omp:1:12:0.172672 +1000:gen_omp:1:12:0.194303 +1000:gen_omp:1:12:0.168983 +1000:gen_omp:1:12:0.200807 +10000:gen_omp:1:12:0.2438 +10000:gen_omp:1:12:0.30915 +10000:gen_omp:1:12:0.262944 +10000:gen_omp:1:12:0.257088 +10000:gen_omp:1:12:0.23366 +10000:gen_omp:1:12:0.271642 +10000:gen_omp:1:12:0.259531 +10000:gen_omp:1:12:0.256281 +10000:gen_omp:1:12:0.330663 +10000:gen_omp:1:12:0.244255 +10000:gen_omp:1:12:0.299726 +10000:gen_omp:1:12:0.250854 +10000:gen_omp:1:12:0.277871 +10000:gen_omp:1:12:0.253399 +10000:gen_omp:1:12:0.325553 +10000:gen_omp:1:12:0.303454 +10000:gen_omp:1:12:0.320191 +10000:gen_omp:1:12:0.305361 +10000:gen_omp:1:12:0.262682 +10000:gen_omp:1:12:0.292835 +100000:gen_omp:1:12:1.38219 +100000:gen_omp:1:12:1.56744 +100000:gen_omp:1:12:1.64431 +100000:gen_omp:1:12:1.66138 +100000:gen_omp:1:12:1.63523 +100000:gen_omp:1:12:1.42683 +100000:gen_omp:1:12:1.52547 +100000:gen_omp:1:12:1.59539 +100000:gen_omp:1:12:1.6279 +100000:gen_omp:1:12:1.59005 +100000:gen_omp:1:12:1.57813 +100000:gen_omp:1:12:1.63168 +100000:gen_omp:1:12:1.47915 +100000:gen_omp:1:12:1.6783 +100000:gen_omp:1:12:1.09709 +100000:gen_omp:1:12:1.70039 +100000:gen_omp:1:12:1.63107 +100000:gen_omp:1:12:1.58926 +100000:gen_omp:1:12:1.6127 +100000:gen_omp:1:12:1.53704 +1000000:gen_omp:1:12:7.24056 +1000000:gen_omp:1:12:6.85732 +1000000:gen_omp:1:12:6.90533 +1000000:gen_omp:1:12:6.74423 +1000000:gen_omp:1:12:7.04829 +1000000:gen_omp:1:12:7.37732 +1000000:gen_omp:1:12:6.92788 +1000000:gen_omp:1:12:7.33178 +1000000:gen_omp:1:12:7.15979 +1000000:gen_omp:1:12:6.99061 +1000000:gen_omp:1:12:7.01632 +1000000:gen_omp:1:12:7.00058 +1000000:gen_omp:1:12:6.76144 +1000000:gen_omp:1:12:7.05508 +1000000:gen_omp:1:12:6.79351 +1000000:gen_omp:1:12:6.63542 +1000000:gen_omp:1:12:6.7649 +1000000:gen_omp:1:12:6.88964 +1000000:gen_omp:1:12:6.85106 +1000000:gen_omp:1:12:6.98138 +10000000:gen_omp:1:12:70.146 +10000000:gen_omp:1:12:70.0103 +10000000:gen_omp:1:12:70.1023 +10000000:gen_omp:1:12:70.0037 +10000000:gen_omp:1:12:69.9819 +10000000:gen_omp:1:12:70.133 +10000000:gen_omp:1:12:70.0896 +10000000:gen_omp:1:12:70.1337 +10000000:gen_omp:1:12:70.173 +10000000:gen_omp:1:12:70.346 +10000000:gen_omp:1:12:70.4144 +10000000:gen_omp:1:12:70.3764 +10000000:gen_omp:1:12:70.1611 +10000000:gen_omp:1:12:70.3899 +10000000:gen_omp:1:12:70.4496 +10000000:gen_omp:1:12:70.2059 +10000000:gen_omp:1:12:69.8352 +10000000:gen_omp:1:12:70.2119 +10000000:gen_omp:1:12:69.9214 +10000000:gen_omp:1:12:70.0788 diff --git a/results/rt/data_basic/rt_size_12_gen_thread b/results/rt/data_basic/rt_size_12_gen_thread new file mode 100644 index 0000000..4230381 --- /dev/null +++ b/results/rt/data_basic/rt_size_12_gen_thread @@ -0,0 +1,120 @@ +100:gen_thread:1:12:0.593512 +100:gen_thread:1:12:0.608002 +100:gen_thread:1:12:0.630435 +100:gen_thread:1:12:0.676025 +100:gen_thread:1:12:0.608014 +100:gen_thread:1:12:0.600465 +100:gen_thread:1:12:0.652704 +100:gen_thread:1:12:0.675291 +100:gen_thread:1:12:0.649477 +100:gen_thread:1:12:0.656121 +100:gen_thread:1:12:0.675013 +100:gen_thread:1:12:0.590834 +100:gen_thread:1:12:0.533447 +100:gen_thread:1:12:0.685446 +100:gen_thread:1:12:0.589158 +100:gen_thread:1:12:0.593077 +100:gen_thread:1:12:0.612163 +100:gen_thread:1:12:0.655336 +100:gen_thread:1:12:0.6962 +100:gen_thread:1:12:0.653921 +1000:gen_thread:1:12:0.630414 +1000:gen_thread:1:12:0.584122 +1000:gen_thread:1:12:0.623846 +1000:gen_thread:1:12:0.672149 +1000:gen_thread:1:12:0.631598 +1000:gen_thread:1:12:0.686463 +1000:gen_thread:1:12:0.598372 +1000:gen_thread:1:12:0.642824 +1000:gen_thread:1:12:0.588275 +1000:gen_thread:1:12:0.63929 +1000:gen_thread:1:12:0.661527 +1000:gen_thread:1:12:0.577798 +1000:gen_thread:1:12:0.676915 +1000:gen_thread:1:12:0.626447 +1000:gen_thread:1:12:0.702965 +1000:gen_thread:1:12:0.66148 +1000:gen_thread:1:12:0.615553 +1000:gen_thread:1:12:0.652267 +1000:gen_thread:1:12:0.536963 +1000:gen_thread:1:12:0.633894 +10000:gen_thread:1:12:0.652137 +10000:gen_thread:1:12:0.648233 +10000:gen_thread:1:12:0.683418 +10000:gen_thread:1:12:0.6256 +10000:gen_thread:1:12:0.655536 +10000:gen_thread:1:12:0.676338 +10000:gen_thread:1:12:0.666457 +10000:gen_thread:1:12:0.728042 +10000:gen_thread:1:12:0.699454 +10000:gen_thread:1:12:0.702943 +10000:gen_thread:1:12:0.649094 +10000:gen_thread:1:12:0.628903 +10000:gen_thread:1:12:0.685317 +10000:gen_thread:1:12:0.637943 +10000:gen_thread:1:12:0.672884 +10000:gen_thread:1:12:0.696593 +10000:gen_thread:1:12:0.728028 +10000:gen_thread:1:12:0.666973 +10000:gen_thread:1:12:0.722154 +10000:gen_thread:1:12:0.677001 +100000:gen_thread:1:12:1.26661 +100000:gen_thread:1:12:1.20304 +100000:gen_thread:1:12:1.21847 +100000:gen_thread:1:12:1.2136 +100000:gen_thread:1:12:1.21074 +100000:gen_thread:1:12:1.19979 +100000:gen_thread:1:12:1.20166 +100000:gen_thread:1:12:1.22469 +100000:gen_thread:1:12:1.20296 +100000:gen_thread:1:12:1.21465 +100000:gen_thread:1:12:1.20438 +100000:gen_thread:1:12:1.21016 +100000:gen_thread:1:12:1.1926 +100000:gen_thread:1:12:1.20739 +100000:gen_thread:1:12:1.20339 +100000:gen_thread:1:12:1.20555 +100000:gen_thread:1:12:1.20052 +100000:gen_thread:1:12:1.20276 +100000:gen_thread:1:12:1.19934 +100000:gen_thread:1:12:1.20446 +1000000:gen_thread:1:12:7.38307 +1000000:gen_thread:1:12:7.47861 +1000000:gen_thread:1:12:7.37652 +1000000:gen_thread:1:12:7.60421 +1000000:gen_thread:1:12:7.69283 +1000000:gen_thread:1:12:7.38403 +1000000:gen_thread:1:12:7.52306 +1000000:gen_thread:1:12:7.37794 +1000000:gen_thread:1:12:7.24099 +1000000:gen_thread:1:12:7.38732 +1000000:gen_thread:1:12:7.4257 +1000000:gen_thread:1:12:7.56674 +1000000:gen_thread:1:12:7.07703 +1000000:gen_thread:1:12:7.27232 +1000000:gen_thread:1:12:7.30237 +1000000:gen_thread:1:12:7.23214 +1000000:gen_thread:1:12:7.47578 +1000000:gen_thread:1:12:7.46766 +1000000:gen_thread:1:12:7.40042 +1000000:gen_thread:1:12:7.32456 +10000000:gen_thread:1:12:95.0211 +10000000:gen_thread:1:12:97.5013 +10000000:gen_thread:1:12:94.053 +10000000:gen_thread:1:12:95.2345 +10000000:gen_thread:1:12:96.1898 +10000000:gen_thread:1:12:93.6081 +10000000:gen_thread:1:12:94.1987 +10000000:gen_thread:1:12:93.836 +10000000:gen_thread:1:12:94.4782 +10000000:gen_thread:1:12:92.7921 +10000000:gen_thread:1:12:94.159 +10000000:gen_thread:1:12:92.7062 +10000000:gen_thread:1:12:95.2957 +10000000:gen_thread:1:12:95.6518 +10000000:gen_thread:1:12:95.1964 +10000000:gen_thread:1:12:94.2001 +10000000:gen_thread:1:12:92.6706 +10000000:gen_thread:1:12:93.4296 +10000000:gen_thread:1:12:92.3483 +10000000:gen_thread:1:12:94.184 diff --git a/results/rt/data_basic/rt_size_12_omp b/results/rt/data_basic/rt_size_12_omp new file mode 100644 index 0000000..7cc7054 --- /dev/null +++ b/results/rt/data_basic/rt_size_12_omp @@ -0,0 +1,120 @@ +100:omp:1:12:0.182653 +100:omp:1:12:0.16692 +100:omp:1:12:0.142187 +100:omp:1:12:0.183753 +100:omp:1:12:0.157897 +100:omp:1:12:0.150709 +100:omp:1:12:0.168619 +100:omp:1:12:0.135863 +100:omp:1:12:0.141504 +100:omp:1:12:0.174071 +100:omp:1:12:0.165098 +100:omp:1:12:0.157305 +100:omp:1:12:0.161493 +100:omp:1:12:0.153727 +100:omp:1:12:0.156836 +100:omp:1:12:0.164739 +100:omp:1:12:0.166444 +100:omp:1:12:0.148954 +100:omp:1:12:0.174641 +100:omp:1:12:0.181604 +1000:omp:1:12:0.17843 +1000:omp:1:12:0.17382 +1000:omp:1:12:0.154678 +1000:omp:1:12:0.193041 +1000:omp:1:12:0.193143 +1000:omp:1:12:0.160463 +1000:omp:1:12:0.164372 +1000:omp:1:12:0.188442 +1000:omp:1:12:0.160525 +1000:omp:1:12:0.169923 +1000:omp:1:12:0.173117 +1000:omp:1:12:0.183706 +1000:omp:1:12:0.17386 +1000:omp:1:12:0.18144 +1000:omp:1:12:0.190189 +1000:omp:1:12:0.180236 +1000:omp:1:12:0.165186 +1000:omp:1:12:0.17201 +1000:omp:1:12:0.169832 +1000:omp:1:12:0.172702 +10000:omp:1:12:0.216488 +10000:omp:1:12:0.213775 +10000:omp:1:12:0.255725 +10000:omp:1:12:0.297517 +10000:omp:1:12:0.274861 +10000:omp:1:12:0.270276 +10000:omp:1:12:0.255845 +10000:omp:1:12:0.21861 +10000:omp:1:12:0.188171 +10000:omp:1:12:0.203294 +10000:omp:1:12:0.213854 +10000:omp:1:12:0.236941 +10000:omp:1:12:0.274676 +10000:omp:1:12:0.296327 +10000:omp:1:12:0.24805 +10000:omp:1:12:0.284474 +10000:omp:1:12:0.231534 +10000:omp:1:12:0.234849 +10000:omp:1:12:0.282692 +10000:omp:1:12:0.286112 +100000:omp:1:12:1.50594 +100000:omp:1:12:1.47868 +100000:omp:1:12:1.46017 +100000:omp:1:12:1.4138 +100000:omp:1:12:1.46592 +100000:omp:1:12:1.46003 +100000:omp:1:12:1.46993 +100000:omp:1:12:1.47481 +100000:omp:1:12:1.23891 +100000:omp:1:12:1.51564 +100000:omp:1:12:1.51569 +100000:omp:1:12:1.42421 +100000:omp:1:12:1.41455 +100000:omp:1:12:1.3238 +100000:omp:1:12:1.52707 +100000:omp:1:12:1.45243 +100000:omp:1:12:1.49779 +100000:omp:1:12:1.441 +100000:omp:1:12:1.28629 +100000:omp:1:12:1.51135 +1000000:omp:1:12:6.56374 +1000000:omp:1:12:6.27654 +1000000:omp:1:12:6.04574 +1000000:omp:1:12:6.28686 +1000000:omp:1:12:6.14969 +1000000:omp:1:12:6.6442 +1000000:omp:1:12:6.51441 +1000000:omp:1:12:6.48977 +1000000:omp:1:12:6.6669 +1000000:omp:1:12:6.5187 +1000000:omp:1:12:6.5559 +1000000:omp:1:12:6.39489 +1000000:omp:1:12:6.28953 +1000000:omp:1:12:6.66885 +1000000:omp:1:12:6.42049 +1000000:omp:1:12:6.08862 +1000000:omp:1:12:6.43063 +1000000:omp:1:12:6.25476 +1000000:omp:1:12:6.44866 +1000000:omp:1:12:6.18695 +10000000:omp:1:12:65.7061 +10000000:omp:1:12:65.6442 +10000000:omp:1:12:65.7472 +10000000:omp:1:12:65.6474 +10000000:omp:1:12:65.8021 +10000000:omp:1:12:65.8112 +10000000:omp:1:12:65.8712 +10000000:omp:1:12:65.6715 +10000000:omp:1:12:65.9282 +10000000:omp:1:12:65.316 +10000000:omp:1:12:65.6144 +10000000:omp:1:12:65.7877 +10000000:omp:1:12:65.8363 +10000000:omp:1:12:65.7193 +10000000:omp:1:12:65.8714 +10000000:omp:1:12:65.6617 +10000000:omp:1:12:66.0291 +10000000:omp:1:12:65.6189 +10000000:omp:1:12:65.5791 +10000000:omp:1:12:65.9151 diff --git a/results/rt/data_basic/rt_size_12_seq b/results/rt/data_basic/rt_size_12_seq new file mode 100644 index 0000000..58c320c --- /dev/null +++ b/results/rt/data_basic/rt_size_12_seq @@ -0,0 +1,120 @@ +100:seq:1:12:0.000705 +100:seq:1:12:0.00065 +100:seq:1:12:0.000597 +100:seq:1:12:0.000593 +100:seq:1:12:0.000606 +100:seq:1:12:0.000556 +100:seq:1:12:0.000552 +100:seq:1:12:0.000552 +100:seq:1:12:0.000566 +100:seq:1:12:0.000566 +100:seq:1:12:0.000568 +100:seq:1:12:0.000566 +100:seq:1:12:0.000568 +100:seq:1:12:0.000566 +100:seq:1:12:0.000552 +100:seq:1:12:0.000565 +100:seq:1:12:0.00057 +100:seq:1:12:0.000566 +100:seq:1:12:0.000532 +100:seq:1:12:0.000522 +1000:seq:1:12:0.005152 +1000:seq:1:12:0.005145 +1000:seq:1:12:0.00514 +1000:seq:1:12:0.005136 +1000:seq:1:12:0.005137 +1000:seq:1:12:0.00483 +1000:seq:1:12:0.004831 +1000:seq:1:12:0.004575 +1000:seq:1:12:0.004568 +1000:seq:1:12:0.004579 +1000:seq:1:12:0.004573 +1000:seq:1:12:0.004553 +1000:seq:1:12:0.006859 +1000:seq:1:12:0.006853 +1000:seq:1:12:0.00632 +1000:seq:1:12:0.00588 +1000:seq:1:12:0.005876 +1000:seq:1:12:0.005877 +1000:seq:1:12:0.005877 +1000:seq:1:12:0.005876 +10000:seq:1:12:0.048636 +10000:seq:1:12:0.038665 +10000:seq:1:12:0.03077 +10000:seq:1:12:0.025523 +10000:seq:1:12:0.025385 +10000:seq:1:12:0.025442 +10000:seq:1:12:0.02534 +10000:seq:1:12:0.025357 +10000:seq:1:12:0.025506 +10000:seq:1:12:0.025429 +10000:seq:1:12:0.025422 +10000:seq:1:12:0.025478 +10000:seq:1:12:0.025456 +10000:seq:1:12:0.025521 +10000:seq:1:12:0.0255 +10000:seq:1:12:0.025512 +10000:seq:1:12:0.025496 +10000:seq:1:12:0.02554 +10000:seq:1:12:0.025496 +10000:seq:1:12:0.025484 +100000:seq:1:12:0.541786 +100000:seq:1:12:0.52904 +100000:seq:1:12:0.533935 +100000:seq:1:12:0.534002 +100000:seq:1:12:0.53059 +100000:seq:1:12:0.535227 +100000:seq:1:12:0.535372 +100000:seq:1:12:0.541857 +100000:seq:1:12:0.540121 +100000:seq:1:12:0.53435 +100000:seq:1:12:0.544736 +100000:seq:1:12:0.536974 +100000:seq:1:12:0.533878 +100000:seq:1:12:0.536009 +100000:seq:1:12:0.536395 +100000:seq:1:12:0.538469 +100000:seq:1:12:0.547789 +100000:seq:1:12:0.536882 +100000:seq:1:12:0.537593 +100000:seq:1:12:0.540689 +1000000:seq:1:12:5.37407 +1000000:seq:1:12:5.38952 +1000000:seq:1:12:5.37089 +1000000:seq:1:12:5.39692 +1000000:seq:1:12:5.42902 +1000000:seq:1:12:5.43248 +1000000:seq:1:12:5.37569 +1000000:seq:1:12:5.39 +1000000:seq:1:12:5.39967 +1000000:seq:1:12:5.40574 +1000000:seq:1:12:5.38309 +1000000:seq:1:12:5.42407 +1000000:seq:1:12:5.38953 +1000000:seq:1:12:5.38113 +1000000:seq:1:12:5.39332 +1000000:seq:1:12:5.35976 +1000000:seq:1:12:5.33967 +1000000:seq:1:12:5.37073 +1000000:seq:1:12:5.34728 +1000000:seq:1:12:5.40538 +10000000:seq:1:12:61.2778 +10000000:seq:1:12:61.3326 +10000000:seq:1:12:61.3182 +10000000:seq:1:12:61.2584 +10000000:seq:1:12:61.3279 +10000000:seq:1:12:61.2799 +10000000:seq:1:12:61.3336 +10000000:seq:1:12:61.2672 +10000000:seq:1:12:61.3393 +10000000:seq:1:12:61.2508 +10000000:seq:1:12:61.374 +10000000:seq:1:12:61.2913 +10000000:seq:1:12:61.3508 +10000000:seq:1:12:61.269 +10000000:seq:1:12:61.3134 +10000000:seq:1:12:61.2459 +10000000:seq:1:12:61.32 +10000000:seq:1:12:61.2438 +10000000:seq:1:12:61.3159 +10000000:seq:1:12:61.2743 diff --git a/results/rt/data_basic/rt_size_14_gen_omp b/results/rt/data_basic/rt_size_14_gen_omp new file mode 100644 index 0000000..596a0d1 --- /dev/null +++ b/results/rt/data_basic/rt_size_14_gen_omp @@ -0,0 +1,120 @@ +100:gen_omp:1:14:0.135257 +100:gen_omp:1:14:0.182762 +100:gen_omp:1:14:0.17158 +100:gen_omp:1:14:0.125488 +100:gen_omp:1:14:0.106492 +100:gen_omp:1:14:0.147731 +100:gen_omp:1:14:0.201078 +100:gen_omp:1:14:0.181464 +100:gen_omp:1:14:0.22155 +100:gen_omp:1:14:0.197098 +100:gen_omp:1:14:0.164243 +100:gen_omp:1:14:0.208214 +100:gen_omp:1:14:0.105578 +100:gen_omp:1:14:0.156587 +100:gen_omp:1:14:0.197459 +100:gen_omp:1:14:0.189272 +100:gen_omp:1:14:0.212697 +100:gen_omp:1:14:0.176679 +100:gen_omp:1:14:0.201104 +100:gen_omp:1:14:0.193804 +1000:gen_omp:1:14:0.15134 +1000:gen_omp:1:14:0.228179 +1000:gen_omp:1:14:0.194437 +1000:gen_omp:1:14:0.190298 +1000:gen_omp:1:14:0.209771 +1000:gen_omp:1:14:0.234145 +1000:gen_omp:1:14:0.206441 +1000:gen_omp:1:14:0.166767 +1000:gen_omp:1:14:0.25355 +1000:gen_omp:1:14:0.210893 +1000:gen_omp:1:14:0.170404 +1000:gen_omp:1:14:0.229151 +1000:gen_omp:1:14:0.19012 +1000:gen_omp:1:14:0.210156 +1000:gen_omp:1:14:0.217235 +1000:gen_omp:1:14:0.179077 +1000:gen_omp:1:14:0.201879 +1000:gen_omp:1:14:0.234256 +1000:gen_omp:1:14:0.184545 +1000:gen_omp:1:14:0.191861 +10000:gen_omp:1:14:0.24465 +10000:gen_omp:1:14:0.314986 +10000:gen_omp:1:14:0.255421 +10000:gen_omp:1:14:0.323809 +10000:gen_omp:1:14:0.278567 +10000:gen_omp:1:14:0.291622 +10000:gen_omp:1:14:0.335446 +10000:gen_omp:1:14:0.325024 +10000:gen_omp:1:14:0.333577 +10000:gen_omp:1:14:0.25587 +10000:gen_omp:1:14:0.30295 +10000:gen_omp:1:14:0.253717 +10000:gen_omp:1:14:0.295269 +10000:gen_omp:1:14:0.309752 +10000:gen_omp:1:14:0.253451 +10000:gen_omp:1:14:0.251346 +10000:gen_omp:1:14:0.333264 +10000:gen_omp:1:14:0.329245 +10000:gen_omp:1:14:0.304935 +10000:gen_omp:1:14:0.286409 +100000:gen_omp:1:14:1.30058 +100000:gen_omp:1:14:1.65322 +100000:gen_omp:1:14:1.63077 +100000:gen_omp:1:14:1.56928 +100000:gen_omp:1:14:1.52749 +100000:gen_omp:1:14:1.43871 +100000:gen_omp:1:14:1.69012 +100000:gen_omp:1:14:1.46414 +100000:gen_omp:1:14:1.58902 +100000:gen_omp:1:14:1.4791 +100000:gen_omp:1:14:1.56373 +100000:gen_omp:1:14:1.59304 +100000:gen_omp:1:14:1.62284 +100000:gen_omp:1:14:1.6382 +100000:gen_omp:1:14:1.5522 +100000:gen_omp:1:14:1.67137 +100000:gen_omp:1:14:1.5894 +100000:gen_omp:1:14:1.64268 +100000:gen_omp:1:14:1.43136 +100000:gen_omp:1:14:1.50975 +1000000:gen_omp:1:14:7.17205 +1000000:gen_omp:1:14:6.86553 +1000000:gen_omp:1:14:6.85802 +1000000:gen_omp:1:14:6.77646 +1000000:gen_omp:1:14:6.93574 +1000000:gen_omp:1:14:7.54157 +1000000:gen_omp:1:14:7.0099 +1000000:gen_omp:1:14:6.99894 +1000000:gen_omp:1:14:6.93602 +1000000:gen_omp:1:14:7.15801 +1000000:gen_omp:1:14:7.02607 +1000000:gen_omp:1:14:6.80168 +1000000:gen_omp:1:14:7.07372 +1000000:gen_omp:1:14:6.84896 +1000000:gen_omp:1:14:6.8245 +1000000:gen_omp:1:14:6.81763 +1000000:gen_omp:1:14:7.60017 +1000000:gen_omp:1:14:7.00835 +1000000:gen_omp:1:14:6.76442 +1000000:gen_omp:1:14:6.7684 +10000000:gen_omp:1:14:70.6276 +10000000:gen_omp:1:14:70.5337 +10000000:gen_omp:1:14:70.4392 +10000000:gen_omp:1:14:70.204 +10000000:gen_omp:1:14:70.5858 +10000000:gen_omp:1:14:70.9255 +10000000:gen_omp:1:14:70.9078 +10000000:gen_omp:1:14:70.8295 +10000000:gen_omp:1:14:70.5035 +10000000:gen_omp:1:14:70.6023 +10000000:gen_omp:1:14:70.5747 +10000000:gen_omp:1:14:70.1382 +10000000:gen_omp:1:14:70.5378 +10000000:gen_omp:1:14:70.2239 +10000000:gen_omp:1:14:70.1123 +10000000:gen_omp:1:14:70.3724 +10000000:gen_omp:1:14:70.2829 +10000000:gen_omp:1:14:70.3166 +10000000:gen_omp:1:14:70.6433 +10000000:gen_omp:1:14:70.6215 diff --git a/results/rt/data_basic/rt_size_14_gen_thread b/results/rt/data_basic/rt_size_14_gen_thread new file mode 100644 index 0000000..54686c7 --- /dev/null +++ b/results/rt/data_basic/rt_size_14_gen_thread @@ -0,0 +1,120 @@ +100:gen_thread:1:14:0.696087 +100:gen_thread:1:14:0.672131 +100:gen_thread:1:14:0.741609 +100:gen_thread:1:14:2.35752 +100:gen_thread:1:14:0.752867 +100:gen_thread:1:14:0.773905 +100:gen_thread:1:14:0.659654 +100:gen_thread:1:14:0.665808 +100:gen_thread:1:14:1.44048 +100:gen_thread:1:14:0.731424 +100:gen_thread:1:14:0.743594 +100:gen_thread:1:14:0.804231 +100:gen_thread:1:14:0.773775 +100:gen_thread:1:14:0.697922 +100:gen_thread:1:14:0.789994 +100:gen_thread:1:14:0.818812 +100:gen_thread:1:14:0.639735 +100:gen_thread:1:14:0.738111 +100:gen_thread:1:14:0.676421 +100:gen_thread:1:14:0.712718 +1000:gen_thread:1:14:0.635039 +1000:gen_thread:1:14:0.70819 +1000:gen_thread:1:14:1.42243 +1000:gen_thread:1:14:0.786045 +1000:gen_thread:1:14:0.765702 +1000:gen_thread:1:14:0.801251 +1000:gen_thread:1:14:0.688944 +1000:gen_thread:1:14:0.723205 +1000:gen_thread:1:14:0.746947 +1000:gen_thread:1:14:0.672788 +1000:gen_thread:1:14:0.694845 +1000:gen_thread:1:14:0.644953 +1000:gen_thread:1:14:0.743964 +1000:gen_thread:1:14:0.685189 +1000:gen_thread:1:14:0.779437 +1000:gen_thread:1:14:0.633919 +1000:gen_thread:1:14:0.655122 +1000:gen_thread:1:14:0.764876 +1000:gen_thread:1:14:0.711036 +1000:gen_thread:1:14:0.741302 +10000:gen_thread:1:14:0.780583 +10000:gen_thread:1:14:0.770586 +10000:gen_thread:1:14:0.774614 +10000:gen_thread:1:14:0.77058 +10000:gen_thread:1:14:0.800571 +10000:gen_thread:1:14:0.827504 +10000:gen_thread:1:14:0.796638 +10000:gen_thread:1:14:1.25997 +10000:gen_thread:1:14:0.793553 +10000:gen_thread:1:14:2.2733 +10000:gen_thread:1:14:0.832912 +10000:gen_thread:1:14:0.764168 +10000:gen_thread:1:14:0.845847 +10000:gen_thread:1:14:0.812549 +10000:gen_thread:1:14:0.770227 +10000:gen_thread:1:14:0.822094 +10000:gen_thread:1:14:0.764849 +10000:gen_thread:1:14:0.723279 +10000:gen_thread:1:14:0.822519 +10000:gen_thread:1:14:1.88441 +100000:gen_thread:1:14:1.43416 +100000:gen_thread:1:14:1.31462 +100000:gen_thread:1:14:1.30981 +100000:gen_thread:1:14:1.31337 +100000:gen_thread:1:14:1.30622 +100000:gen_thread:1:14:1.30629 +100000:gen_thread:1:14:1.29542 +100000:gen_thread:1:14:1.31779 +100000:gen_thread:1:14:1.30888 +100000:gen_thread:1:14:1.31497 +100000:gen_thread:1:14:1.31206 +100000:gen_thread:1:14:1.31541 +100000:gen_thread:1:14:1.31534 +100000:gen_thread:1:14:1.31175 +100000:gen_thread:1:14:1.30213 +100000:gen_thread:1:14:1.30591 +100000:gen_thread:1:14:1.31203 +100000:gen_thread:1:14:1.30754 +100000:gen_thread:1:14:1.31323 +100000:gen_thread:1:14:1.31755 +1000000:gen_thread:1:14:7.34443 +1000000:gen_thread:1:14:7.69502 +1000000:gen_thread:1:14:7.63404 +1000000:gen_thread:1:14:7.60713 +1000000:gen_thread:1:14:7.45676 +1000000:gen_thread:1:14:7.93888 +1000000:gen_thread:1:14:7.98069 +1000000:gen_thread:1:14:8.11648 +1000000:gen_thread:1:14:7.71284 +1000000:gen_thread:1:14:7.37332 +1000000:gen_thread:1:14:7.86741 +1000000:gen_thread:1:14:7.44713 +1000000:gen_thread:1:14:7.72461 +1000000:gen_thread:1:14:9.01304 +1000000:gen_thread:1:14:8.88085 +1000000:gen_thread:1:14:7.51138 +1000000:gen_thread:1:14:7.79568 +1000000:gen_thread:1:14:7.68152 +1000000:gen_thread:1:14:7.51614 +1000000:gen_thread:1:14:7.88713 +10000000:gen_thread:1:14:94.8114 +10000000:gen_thread:1:14:96.3333 +10000000:gen_thread:1:14:94.5475 +10000000:gen_thread:1:14:95.3258 +10000000:gen_thread:1:14:92.4762 +10000000:gen_thread:1:14:93.5306 +10000000:gen_thread:1:14:93.5378 +10000000:gen_thread:1:14:93.3272 +10000000:gen_thread:1:14:95.3283 +10000000:gen_thread:1:14:96.8181 +10000000:gen_thread:1:14:95.1283 +10000000:gen_thread:1:14:94.2505 +10000000:gen_thread:1:14:91.5634 +10000000:gen_thread:1:14:95.5002 +10000000:gen_thread:1:14:94.536 +10000000:gen_thread:1:14:93.9727 +10000000:gen_thread:1:14:94.783 +10000000:gen_thread:1:14:77.9574 +10000000:gen_thread:1:14:96.3224 +10000000:gen_thread:1:14:94.0634 diff --git a/results/rt/data_basic/rt_size_14_omp b/results/rt/data_basic/rt_size_14_omp new file mode 100644 index 0000000..dd3c85f --- /dev/null +++ b/results/rt/data_basic/rt_size_14_omp @@ -0,0 +1,120 @@ +100:omp:1:14:0.203159 +100:omp:1:14:0.169474 +100:omp:1:14:0.18426 +100:omp:1:14:0.175495 +100:omp:1:14:0.182448 +100:omp:1:14:0.126057 +100:omp:1:14:0.180658 +100:omp:1:14:0.173315 +100:omp:1:14:0.169784 +100:omp:1:14:0.201361 +100:omp:1:14:0.127286 +100:omp:1:14:0.12701 +100:omp:1:14:0.168996 +100:omp:1:14:0.190439 +100:omp:1:14:0.191922 +100:omp:1:14:0.186217 +100:omp:1:14:0.19434 +100:omp:1:14:0.179182 +100:omp:1:14:0.176117 +100:omp:1:14:0.175459 +1000:omp:1:14:0.187805 +1000:omp:1:14:0.207634 +1000:omp:1:14:0.187948 +1000:omp:1:14:0.172395 +1000:omp:1:14:0.214245 +1000:omp:1:14:0.218327 +1000:omp:1:14:0.205884 +1000:omp:1:14:0.229789 +1000:omp:1:14:0.222607 +1000:omp:1:14:0.210857 +1000:omp:1:14:0.208107 +1000:omp:1:14:0.207182 +1000:omp:1:14:0.188631 +1000:omp:1:14:0.217726 +1000:omp:1:14:0.192967 +1000:omp:1:14:0.177028 +1000:omp:1:14:0.195924 +1000:omp:1:14:0.190945 +1000:omp:1:14:0.198058 +1000:omp:1:14:0.204915 +10000:omp:1:14:0.263253 +10000:omp:1:14:0.321604 +10000:omp:1:14:0.293173 +10000:omp:1:14:0.227032 +10000:omp:1:14:0.277033 +10000:omp:1:14:0.271202 +10000:omp:1:14:0.207578 +10000:omp:1:14:0.181846 +10000:omp:1:14:0.281823 +10000:omp:1:14:0.292437 +10000:omp:1:14:0.31882 +10000:omp:1:14:0.317739 +10000:omp:1:14:0.31606 +10000:omp:1:14:0.247096 +10000:omp:1:14:0.256993 +10000:omp:1:14:0.257655 +10000:omp:1:14:0.311859 +10000:omp:1:14:0.274659 +10000:omp:1:14:0.27077 +10000:omp:1:14:0.313643 +100000:omp:1:14:1.41131 +100000:omp:1:14:1.2752 +100000:omp:1:14:1.38252 +100000:omp:1:14:1.40797 +100000:omp:1:14:1.44259 +100000:omp:1:14:1.3616 +100000:omp:1:14:1.2236 +100000:omp:1:14:1.47723 +100000:omp:1:14:1.42888 +100000:omp:1:14:1.34968 +100000:omp:1:14:1.42871 +100000:omp:1:14:1.25692 +100000:omp:1:14:1.41161 +100000:omp:1:14:1.42044 +100000:omp:1:14:1.41853 +100000:omp:1:14:1.32878 +100000:omp:1:14:1.319 +100000:omp:1:14:1.44838 +100000:omp:1:14:1.44432 +100000:omp:1:14:1.45884 +1000000:omp:1:14:7.3392 +1000000:omp:1:14:6.15839 +1000000:omp:1:14:6.32856 +1000000:omp:1:14:6.27738 +1000000:omp:1:14:6.19322 +1000000:omp:1:14:6.64213 +1000000:omp:1:14:6.39362 +1000000:omp:1:14:6.32526 +1000000:omp:1:14:6.85788 +1000000:omp:1:14:6.45496 +1000000:omp:1:14:7.04001 +1000000:omp:1:14:6.35141 +1000000:omp:1:14:6.44192 +1000000:omp:1:14:6.78749 +1000000:omp:1:14:6.5417 +1000000:omp:1:14:6.77412 +1000000:omp:1:14:6.30159 +1000000:omp:1:14:6.46464 +1000000:omp:1:14:6.36761 +1000000:omp:1:14:6.33026 +10000000:omp:1:14:65.6517 +10000000:omp:1:14:65.8449 +10000000:omp:1:14:65.5561 +10000000:omp:1:14:65.6979 +10000000:omp:1:14:65.6931 +10000000:omp:1:14:65.6617 +10000000:omp:1:14:65.7597 +10000000:omp:1:14:65.6665 +10000000:omp:1:14:65.4716 +10000000:omp:1:14:65.8026 +10000000:omp:1:14:65.6005 +10000000:omp:1:14:65.7514 +10000000:omp:1:14:65.8459 +10000000:omp:1:14:65.7529 +10000000:omp:1:14:65.5811 +10000000:omp:1:14:65.6105 +10000000:omp:1:14:66.0529 +10000000:omp:1:14:65.5004 +10000000:omp:1:14:65.7412 +10000000:omp:1:14:65.7568 diff --git a/results/rt/data_basic/rt_size_14_seq b/results/rt/data_basic/rt_size_14_seq new file mode 100644 index 0000000..655352c --- /dev/null +++ b/results/rt/data_basic/rt_size_14_seq @@ -0,0 +1,120 @@ +100:seq:1:14:0.000707 +100:seq:1:14:0.000569 +100:seq:1:14:0.000558 +100:seq:1:14:0.000562 +100:seq:1:14:0.000565 +100:seq:1:14:0.000562 +100:seq:1:14:0.000565 +100:seq:1:14:0.000562 +100:seq:1:14:0.000558 +100:seq:1:14:0.000568 +100:seq:1:14:0.000552 +100:seq:1:14:0.000534 +100:seq:1:14:0.000529 +100:seq:1:14:0.000522 +100:seq:1:14:0.000488 +100:seq:1:14:0.000488 +100:seq:1:14:0.000488 +100:seq:1:14:0.000501 +100:seq:1:14:0.000487 +100:seq:1:14:0.000519 +1000:seq:1:14:0.00515 +1000:seq:1:14:0.005147 +1000:seq:1:14:0.005136 +1000:seq:1:14:0.004831 +1000:seq:1:14:0.004837 +1000:seq:1:14:0.00457 +1000:seq:1:14:0.004559 +1000:seq:1:14:0.004561 +1000:seq:1:14:0.004564 +1000:seq:1:14:0.00433 +1000:seq:1:14:0.004109 +1000:seq:1:14:0.004113 +1000:seq:1:14:0.004105 +1000:seq:1:14:0.0041 +1000:seq:1:14:0.004129 +1000:seq:1:14:0.004106 +1000:seq:1:14:0.004335 +1000:seq:1:14:0.004317 +1000:seq:1:14:0.004332 +1000:seq:1:14:0.004339 +10000:seq:1:14:0.040469 +10000:seq:1:14:0.035747 +10000:seq:1:14:0.030066 +10000:seq:1:14:0.025519 +10000:seq:1:14:0.025487 +10000:seq:1:14:0.025331 +10000:seq:1:14:0.025395 +10000:seq:1:14:0.025412 +10000:seq:1:14:0.025413 +10000:seq:1:14:0.025319 +10000:seq:1:14:0.025489 +10000:seq:1:14:0.025316 +10000:seq:1:14:0.025347 +10000:seq:1:14:0.025318 +10000:seq:1:14:0.025373 +10000:seq:1:14:0.025368 +10000:seq:1:14:0.025438 +10000:seq:1:14:0.025594 +10000:seq:1:14:0.025426 +10000:seq:1:14:0.025441 +100000:seq:1:14:0.541499 +100000:seq:1:14:0.53993 +100000:seq:1:14:0.543681 +100000:seq:1:14:0.537943 +100000:seq:1:14:0.537566 +100000:seq:1:14:0.539072 +100000:seq:1:14:0.536083 +100000:seq:1:14:0.538397 +100000:seq:1:14:0.540346 +100000:seq:1:14:0.541728 +100000:seq:1:14:0.541782 +100000:seq:1:14:0.539965 +100000:seq:1:14:0.538398 +100000:seq:1:14:0.533226 +100000:seq:1:14:0.544333 +100000:seq:1:14:0.537943 +100000:seq:1:14:0.546625 +100000:seq:1:14:0.529777 +100000:seq:1:14:0.53928 +100000:seq:1:14:0.534828 +1000000:seq:1:14:5.38448 +1000000:seq:1:14:5.39909 +1000000:seq:1:14:5.41711 +1000000:seq:1:14:5.3928 +1000000:seq:1:14:5.39972 +1000000:seq:1:14:5.40392 +1000000:seq:1:14:5.42517 +1000000:seq:1:14:5.38694 +1000000:seq:1:14:5.38065 +1000000:seq:1:14:5.3914 +1000000:seq:1:14:5.39004 +1000000:seq:1:14:5.38613 +1000000:seq:1:14:5.36613 +1000000:seq:1:14:5.36526 +1000000:seq:1:14:5.39656 +1000000:seq:1:14:5.39138 +1000000:seq:1:14:5.34844 +1000000:seq:1:14:5.39854 +1000000:seq:1:14:5.35707 +1000000:seq:1:14:5.39086 +10000000:seq:1:14:61.3048 +10000000:seq:1:14:61.2691 +10000000:seq:1:14:61.2723 +10000000:seq:1:14:61.262 +10000000:seq:1:14:61.2238 +10000000:seq:1:14:61.2673 +10000000:seq:1:14:60.5883 +10000000:seq:1:14:61.2886 +10000000:seq:1:14:61.3053 +10000000:seq:1:14:61.2912 +10000000:seq:1:14:61.2788 +10000000:seq:1:14:61.1992 +10000000:seq:1:14:61.2011 +10000000:seq:1:14:61.3106 +10000000:seq:1:14:61.2043 +10000000:seq:1:14:61.2459 +10000000:seq:1:14:61.1507 +10000000:seq:1:14:61.2911 +10000000:seq:1:14:61.2316 +10000000:seq:1:14:61.3297 diff --git a/results/rt/data_basic/rt_size_16_gen_omp b/results/rt/data_basic/rt_size_16_gen_omp new file mode 100644 index 0000000..e35c441 --- /dev/null +++ b/results/rt/data_basic/rt_size_16_gen_omp @@ -0,0 +1,120 @@ +100:gen_omp:1:16:0.133894 +100:gen_omp:1:16:0.201292 +100:gen_omp:1:16:0.165412 +100:gen_omp:1:16:0.147633 +100:gen_omp:1:16:0.199011 +100:gen_omp:1:16:0.20265 +100:gen_omp:1:16:0.215295 +100:gen_omp:1:16:0.21345 +100:gen_omp:1:16:0.206347 +100:gen_omp:1:16:0.195977 +100:gen_omp:1:16:0.194141 +100:gen_omp:1:16:0.202901 +100:gen_omp:1:16:0.230419 +100:gen_omp:1:16:0.253262 +100:gen_omp:1:16:0.187509 +100:gen_omp:1:16:0.1476 +100:gen_omp:1:16:0.147799 +100:gen_omp:1:16:0.241745 +100:gen_omp:1:16:0.229559 +100:gen_omp:1:16:0.213174 +1000:gen_omp:1:16:0.202505 +1000:gen_omp:1:16:0.151896 +1000:gen_omp:1:16:0.190856 +1000:gen_omp:1:16:0.229138 +1000:gen_omp:1:16:0.201996 +1000:gen_omp:1:16:0.188703 +1000:gen_omp:1:16:0.205315 +1000:gen_omp:1:16:0.151496 +1000:gen_omp:1:16:0.151198 +1000:gen_omp:1:16:0.150667 +1000:gen_omp:1:16:0.150567 +1000:gen_omp:1:16:0.177412 +1000:gen_omp:1:16:0.202957 +1000:gen_omp:1:16:0.150594 +1000:gen_omp:1:16:0.17451 +1000:gen_omp:1:16:0.208158 +1000:gen_omp:1:16:0.198339 +1000:gen_omp:1:16:0.188937 +1000:gen_omp:1:16:0.206284 +1000:gen_omp:1:16:0.228528 +10000:gen_omp:1:16:0.275843 +10000:gen_omp:1:16:0.288116 +10000:gen_omp:1:16:0.274394 +10000:gen_omp:1:16:0.326023 +10000:gen_omp:1:16:0.254723 +10000:gen_omp:1:16:0.278837 +10000:gen_omp:1:16:0.2542 +10000:gen_omp:1:16:0.366703 +10000:gen_omp:1:16:0.338565 +10000:gen_omp:1:16:0.24296 +10000:gen_omp:1:16:0.25104 +10000:gen_omp:1:16:0.367187 +10000:gen_omp:1:16:0.314668 +10000:gen_omp:1:16:0.253045 +10000:gen_omp:1:16:0.26276 +10000:gen_omp:1:16:0.28852 +10000:gen_omp:1:16:0.344589 +10000:gen_omp:1:16:0.328365 +10000:gen_omp:1:16:0.320342 +10000:gen_omp:1:16:0.285524 +100000:gen_omp:1:16:1.49119 +100000:gen_omp:1:16:1.58653 +100000:gen_omp:1:16:1.29778 +100000:gen_omp:1:16:1.5142 +100000:gen_omp:1:16:1.49195 +100000:gen_omp:1:16:1.59656 +100000:gen_omp:1:16:1.57351 +100000:gen_omp:1:16:1.51683 +100000:gen_omp:1:16:1.66374 +100000:gen_omp:1:16:1.67166 +100000:gen_omp:1:16:1.48425 +100000:gen_omp:1:16:1.5129 +100000:gen_omp:1:16:1.20943 +100000:gen_omp:1:16:1.63474 +100000:gen_omp:1:16:1.50723 +100000:gen_omp:1:16:1.62827 +100000:gen_omp:1:16:1.51129 +100000:gen_omp:1:16:1.36943 +100000:gen_omp:1:16:1.61345 +100000:gen_omp:1:16:1.55709 +1000000:gen_omp:1:16:7.37334 +1000000:gen_omp:1:16:7.16242 +1000000:gen_omp:1:16:6.97769 +1000000:gen_omp:1:16:6.86307 +1000000:gen_omp:1:16:6.78052 +1000000:gen_omp:1:16:7.02598 +1000000:gen_omp:1:16:7.10894 +1000000:gen_omp:1:16:6.81154 +1000000:gen_omp:1:16:6.91702 +1000000:gen_omp:1:16:7.03695 +1000000:gen_omp:1:16:6.98884 +1000000:gen_omp:1:16:7.00148 +1000000:gen_omp:1:16:7.20805 +1000000:gen_omp:1:16:6.91108 +1000000:gen_omp:1:16:6.84883 +1000000:gen_omp:1:16:7.10896 +1000000:gen_omp:1:16:7.06229 +1000000:gen_omp:1:16:7.00724 +1000000:gen_omp:1:16:6.84137 +1000000:gen_omp:1:16:7.01926 +10000000:gen_omp:1:16:70.3187 +10000000:gen_omp:1:16:70.4877 +10000000:gen_omp:1:16:70.4997 +10000000:gen_omp:1:16:70.5995 +10000000:gen_omp:1:16:70.2713 +10000000:gen_omp:1:16:70.4825 +10000000:gen_omp:1:16:70.3787 +10000000:gen_omp:1:16:70.4974 +10000000:gen_omp:1:16:70.7178 +10000000:gen_omp:1:16:70.3575 +10000000:gen_omp:1:16:70.4639 +10000000:gen_omp:1:16:70.6803 +10000000:gen_omp:1:16:70.3538 +10000000:gen_omp:1:16:70.6955 +10000000:gen_omp:1:16:70.5871 +10000000:gen_omp:1:16:70.4381 +10000000:gen_omp:1:16:70.3275 +10000000:gen_omp:1:16:70.4833 +10000000:gen_omp:1:16:70.3804 +10000000:gen_omp:1:16:70.3251 diff --git a/results/rt/data_basic/rt_size_16_gen_thread b/results/rt/data_basic/rt_size_16_gen_thread new file mode 100644 index 0000000..ee5e549 --- /dev/null +++ b/results/rt/data_basic/rt_size_16_gen_thread @@ -0,0 +1,120 @@ +100:gen_thread:1:16:0.845827 +100:gen_thread:1:16:0.887394 +100:gen_thread:1:16:0.897757 +100:gen_thread:1:16:0.815565 +100:gen_thread:1:16:0.852654 +100:gen_thread:1:16:0.902965 +100:gen_thread:1:16:0.781313 +100:gen_thread:1:16:0.850115 +100:gen_thread:1:16:0.94247 +100:gen_thread:1:16:2.32117 +100:gen_thread:1:16:0.896247 +100:gen_thread:1:16:0.854677 +100:gen_thread:1:16:0.843208 +100:gen_thread:1:16:0.812193 +100:gen_thread:1:16:0.826639 +100:gen_thread:1:16:0.910432 +100:gen_thread:1:16:0.809615 +100:gen_thread:1:16:0.820346 +100:gen_thread:1:16:0.848442 +100:gen_thread:1:16:0.885 +1000:gen_thread:1:16:0.830344 +1000:gen_thread:1:16:0.920318 +1000:gen_thread:1:16:0.964855 +1000:gen_thread:1:16:0.915782 +1000:gen_thread:1:16:0.857452 +1000:gen_thread:1:16:0.96396 +1000:gen_thread:1:16:0.80439 +1000:gen_thread:1:16:0.87009 +1000:gen_thread:1:16:0.811158 +1000:gen_thread:1:16:0.811486 +1000:gen_thread:1:16:0.758362 +1000:gen_thread:1:16:0.877037 +1000:gen_thread:1:16:0.840765 +1000:gen_thread:1:16:0.898734 +1000:gen_thread:1:16:0.890281 +1000:gen_thread:1:16:0.777421 +1000:gen_thread:1:16:0.891189 +1000:gen_thread:1:16:0.850101 +1000:gen_thread:1:16:0.890397 +1000:gen_thread:1:16:0.825948 +10000:gen_thread:1:16:0.943698 +10000:gen_thread:1:16:0.971363 +10000:gen_thread:1:16:2.44642 +10000:gen_thread:1:16:0.893989 +10000:gen_thread:1:16:0.834769 +10000:gen_thread:1:16:0.994966 +10000:gen_thread:1:16:0.92779 +10000:gen_thread:1:16:0.833009 +10000:gen_thread:1:16:0.839038 +10000:gen_thread:1:16:0.953674 +10000:gen_thread:1:16:0.899712 +10000:gen_thread:1:16:0.880773 +10000:gen_thread:1:16:0.888921 +10000:gen_thread:1:16:0.955102 +10000:gen_thread:1:16:0.956035 +10000:gen_thread:1:16:0.895615 +10000:gen_thread:1:16:0.888545 +10000:gen_thread:1:16:0.898345 +10000:gen_thread:1:16:0.837211 +10000:gen_thread:1:16:0.961383 +100000:gen_thread:1:16:1.50684 +100000:gen_thread:1:16:1.47002 +100000:gen_thread:1:16:1.46186 +100000:gen_thread:1:16:1.46141 +100000:gen_thread:1:16:1.46742 +100000:gen_thread:1:16:1.47229 +100000:gen_thread:1:16:1.46768 +100000:gen_thread:1:16:1.46843 +100000:gen_thread:1:16:1.45929 +100000:gen_thread:1:16:1.4587 +100000:gen_thread:1:16:1.46575 +100000:gen_thread:1:16:1.46823 +100000:gen_thread:1:16:1.45824 +100000:gen_thread:1:16:1.4683 +100000:gen_thread:1:16:1.46419 +100000:gen_thread:1:16:1.46947 +100000:gen_thread:1:16:1.47706 +100000:gen_thread:1:16:1.45897 +100000:gen_thread:1:16:1.46482 +100000:gen_thread:1:16:1.4786 +1000000:gen_thread:1:16:7.7757 +1000000:gen_thread:1:16:7.88891 +1000000:gen_thread:1:16:7.97938 +1000000:gen_thread:1:16:7.82717 +1000000:gen_thread:1:16:8.00628 +1000000:gen_thread:1:16:7.84049 +1000000:gen_thread:1:16:7.92227 +1000000:gen_thread:1:16:7.77392 +1000000:gen_thread:1:16:7.9225 +1000000:gen_thread:1:16:7.8459 +1000000:gen_thread:1:16:9.0472 +1000000:gen_thread:1:16:7.94331 +1000000:gen_thread:1:16:7.84587 +1000000:gen_thread:1:16:7.96833 +1000000:gen_thread:1:16:7.94406 +1000000:gen_thread:1:16:8.00306 +1000000:gen_thread:1:16:8.04404 +1000000:gen_thread:1:16:8.28205 +1000000:gen_thread:1:16:8.87793 +1000000:gen_thread:1:16:7.98897 +10000000:gen_thread:1:16:99.5761 +10000000:gen_thread:1:16:99.044 +10000000:gen_thread:1:16:97.7065 +10000000:gen_thread:1:16:98.2668 +10000000:gen_thread:1:16:97.3301 +10000000:gen_thread:1:16:90.2072 +10000000:gen_thread:1:16:96.6615 +10000000:gen_thread:1:16:97.7572 +10000000:gen_thread:1:16:96.4454 +10000000:gen_thread:1:16:96.1403 +10000000:gen_thread:1:16:97.5835 +10000000:gen_thread:1:16:97.5353 +10000000:gen_thread:1:16:98.3772 +10000000:gen_thread:1:16:97.9815 +10000000:gen_thread:1:16:90.6106 +10000000:gen_thread:1:16:98.6442 +10000000:gen_thread:1:16:94.8855 +10000000:gen_thread:1:16:101.913 +10000000:gen_thread:1:16:98.1215 +10000000:gen_thread:1:16:97.2888 diff --git a/results/rt/data_basic/rt_size_16_omp b/results/rt/data_basic/rt_size_16_omp new file mode 100644 index 0000000..5ac3a1b --- /dev/null +++ b/results/rt/data_basic/rt_size_16_omp @@ -0,0 +1,120 @@ +100:omp:1:16:0.23473 +100:omp:1:16:0.146436 +100:omp:1:16:0.146074 +100:omp:1:16:0.123612 +100:omp:1:16:0.203968 +100:omp:1:16:0.20963 +100:omp:1:16:0.164563 +100:omp:1:16:0.179212 +100:omp:1:16:0.230183 +100:omp:1:16:0.148931 +100:omp:1:16:0.143911 +100:omp:1:16:0.144401 +100:omp:1:16:0.144669 +100:omp:1:16:0.16434 +100:omp:1:16:0.178363 +100:omp:1:16:0.225764 +100:omp:1:16:0.195018 +100:omp:1:16:0.194834 +100:omp:1:16:0.201924 +100:omp:1:16:0.211831 +1000:omp:1:16:0.17095 +1000:omp:1:16:0.189575 +1000:omp:1:16:0.24268 +1000:omp:1:16:0.220935 +1000:omp:1:16:0.150542 +1000:omp:1:16:0.149701 +1000:omp:1:16:0.201321 +1000:omp:1:16:0.180389 +1000:omp:1:16:0.149382 +1000:omp:1:16:0.170908 +1000:omp:1:16:0.202632 +1000:omp:1:16:0.220686 +1000:omp:1:16:0.149795 +1000:omp:1:16:0.218396 +1000:omp:1:16:0.218904 +1000:omp:1:16:0.144329 +1000:omp:1:16:0.149387 +1000:omp:1:16:0.149869 +1000:omp:1:16:0.148957 +1000:omp:1:16:0.215765 +10000:omp:1:16:0.280554 +10000:omp:1:16:0.226615 +10000:omp:1:16:0.29385 +10000:omp:1:16:0.242725 +10000:omp:1:16:0.343229 +10000:omp:1:16:0.235141 +10000:omp:1:16:0.244249 +10000:omp:1:16:0.26926 +10000:omp:1:16:0.231681 +10000:omp:1:16:0.274825 +10000:omp:1:16:0.263782 +10000:omp:1:16:0.268876 +10000:omp:1:16:0.260694 +10000:omp:1:16:0.302333 +10000:omp:1:16:0.282074 +10000:omp:1:16:0.297696 +10000:omp:1:16:0.224761 +10000:omp:1:16:0.243684 +10000:omp:1:16:0.210686 +10000:omp:1:16:0.233946 +100000:omp:1:16:1.25958 +100000:omp:1:16:1.22176 +100000:omp:1:16:1.31119 +100000:omp:1:16:1.46013 +100000:omp:1:16:1.48088 +100000:omp:1:16:1.30032 +100000:omp:1:16:1.33694 +100000:omp:1:16:1.17849 +100000:omp:1:16:1.44967 +100000:omp:1:16:1.41403 +100000:omp:1:16:1.45185 +100000:omp:1:16:1.39598 +100000:omp:1:16:1.11691 +100000:omp:1:16:1.46952 +100000:omp:1:16:1.24053 +100000:omp:1:16:1.31286 +100000:omp:1:16:1.37408 +100000:omp:1:16:1.16378 +100000:omp:1:16:1.31184 +100000:omp:1:16:1.37411 +1000000:omp:1:16:6.9954 +1000000:omp:1:16:6.40878 +1000000:omp:1:16:6.22486 +1000000:omp:1:16:6.18365 +1000000:omp:1:16:6.81944 +1000000:omp:1:16:6.76818 +1000000:omp:1:16:6.22727 +1000000:omp:1:16:6.28211 +1000000:omp:1:16:6.53925 +1000000:omp:1:16:6.6524 +1000000:omp:1:16:6.21496 +1000000:omp:1:16:6.66507 +1000000:omp:1:16:6.89628 +1000000:omp:1:16:6.47641 +1000000:omp:1:16:6.17575 +1000000:omp:1:16:6.12523 +1000000:omp:1:16:6.90806 +1000000:omp:1:16:6.47872 +1000000:omp:1:16:6.98393 +1000000:omp:1:16:6.41016 +10000000:omp:1:16:66.0535 +10000000:omp:1:16:66.1548 +10000000:omp:1:16:66.2598 +10000000:omp:1:16:66.0868 +10000000:omp:1:16:66.2559 +10000000:omp:1:16:66.0664 +10000000:omp:1:16:66.1904 +10000000:omp:1:16:66.285 +10000000:omp:1:16:66.1567 +10000000:omp:1:16:66.2096 +10000000:omp:1:16:66.1601 +10000000:omp:1:16:65.9864 +10000000:omp:1:16:66.4873 +10000000:omp:1:16:66.2579 +10000000:omp:1:16:66.1545 +10000000:omp:1:16:66.2666 +10000000:omp:1:16:66.2645 +10000000:omp:1:16:66.1537 +10000000:omp:1:16:66.2563 +10000000:omp:1:16:66.1968 diff --git a/results/rt/data_basic/rt_size_16_seq b/results/rt/data_basic/rt_size_16_seq new file mode 100644 index 0000000..c59bb62 --- /dev/null +++ b/results/rt/data_basic/rt_size_16_seq @@ -0,0 +1,120 @@ +100:seq:1:16:0.000704 +100:seq:1:16:0.000651 +100:seq:1:16:0.000593 +100:seq:1:16:0.000607 +100:seq:1:16:0.000592 +100:seq:1:16:0.000552 +100:seq:1:16:0.000564 +100:seq:1:16:0.000566 +100:seq:1:16:0.000565 +100:seq:1:16:0.000518 +100:seq:1:16:0.00053 +100:seq:1:16:0.000529 +100:seq:1:16:0.000488 +100:seq:1:16:0.000529 +100:seq:1:16:0.000516 +100:seq:1:16:0.000534 +100:seq:1:16:0.000532 +100:seq:1:16:0.000518 +100:seq:1:16:0.00053 +100:seq:1:16:0.000501 +1000:seq:1:16:0.004842 +1000:seq:1:16:0.00485 +1000:seq:1:16:0.004582 +1000:seq:1:16:0.004341 +1000:seq:1:16:0.004115 +1000:seq:1:16:0.004111 +1000:seq:1:16:0.003917 +1000:seq:1:16:0.003911 +1000:seq:1:16:0.003915 +1000:seq:1:16:0.003908 +1000:seq:1:16:0.003919 +1000:seq:1:16:0.003918 +1000:seq:1:16:0.003735 +1000:seq:1:16:0.003735 +1000:seq:1:16:0.003738 +1000:seq:1:16:0.003912 +1000:seq:1:16:0.003907 +1000:seq:1:16:0.003915 +1000:seq:1:16:0.003909 +1000:seq:1:16:0.003904 +10000:seq:1:16:0.037262 +10000:seq:1:16:0.030517 +10000:seq:1:16:0.025446 +10000:seq:1:16:0.025522 +10000:seq:1:16:0.025419 +10000:seq:1:16:0.025396 +10000:seq:1:16:0.025513 +10000:seq:1:16:0.025323 +10000:seq:1:16:0.025409 +10000:seq:1:16:0.025597 +10000:seq:1:16:0.025437 +10000:seq:1:16:0.025676 +10000:seq:1:16:0.025329 +10000:seq:1:16:0.025429 +10000:seq:1:16:0.025373 +10000:seq:1:16:0.025355 +10000:seq:1:16:0.025488 +10000:seq:1:16:0.02547 +10000:seq:1:16:0.025556 +10000:seq:1:16:0.025361 +100000:seq:1:16:0.533527 +100000:seq:1:16:0.534837 +100000:seq:1:16:0.53621 +100000:seq:1:16:0.53869 +100000:seq:1:16:0.535725 +100000:seq:1:16:0.537571 +100000:seq:1:16:0.536922 +100000:seq:1:16:0.528546 +100000:seq:1:16:0.531538 +100000:seq:1:16:0.541205 +100000:seq:1:16:0.53137 +100000:seq:1:16:0.538254 +100000:seq:1:16:0.539484 +100000:seq:1:16:0.533881 +100000:seq:1:16:0.545989 +100000:seq:1:16:0.538938 +100000:seq:1:16:0.545381 +100000:seq:1:16:0.53768 +100000:seq:1:16:0.543364 +100000:seq:1:16:0.536257 +1000000:seq:1:16:5.3689 +1000000:seq:1:16:5.41752 +1000000:seq:1:16:5.37014 +1000000:seq:1:16:5.3879 +1000000:seq:1:16:5.38465 +1000000:seq:1:16:5.37294 +1000000:seq:1:16:5.38027 +1000000:seq:1:16:5.36287 +1000000:seq:1:16:5.40081 +1000000:seq:1:16:5.35913 +1000000:seq:1:16:5.39438 +1000000:seq:1:16:5.40595 +1000000:seq:1:16:5.36538 +1000000:seq:1:16:5.40309 +1000000:seq:1:16:5.36702 +1000000:seq:1:16:5.37649 +1000000:seq:1:16:5.37049 +1000000:seq:1:16:5.36186 +1000000:seq:1:16:5.36041 +1000000:seq:1:16:5.39954 +10000000:seq:1:16:61.3431 +10000000:seq:1:16:61.2427 +10000000:seq:1:16:61.2652 +10000000:seq:1:16:61.2133 +10000000:seq:1:16:61.2952 +10000000:seq:1:16:61.236 +10000000:seq:1:16:61.4162 +10000000:seq:1:16:61.3331 +10000000:seq:1:16:61.3775 +10000000:seq:1:16:61.3261 +10000000:seq:1:16:61.2963 +10000000:seq:1:16:61.3261 +10000000:seq:1:16:61.2563 +10000000:seq:1:16:61.3576 +10000000:seq:1:16:61.3164 +10000000:seq:1:16:61.2602 +10000000:seq:1:16:61.2607 +10000000:seq:1:16:61.3416 +10000000:seq:1:16:61.2487 +10000000:seq:1:16:61.2497 diff --git a/results/rt/data_basic/rt_size_18_gen_omp b/results/rt/data_basic/rt_size_18_gen_omp new file mode 100644 index 0000000..edbaaae --- /dev/null +++ b/results/rt/data_basic/rt_size_18_gen_omp @@ -0,0 +1,120 @@ +100:gen_omp:1:18:0.169695 +100:gen_omp:1:18:0.163202 +100:gen_omp:1:18:0.213167 +100:gen_omp:1:18:0.230666 +100:gen_omp:1:18:0.179424 +100:gen_omp:1:18:0.171857 +100:gen_omp:1:18:0.178481 +100:gen_omp:1:18:0.161491 +100:gen_omp:1:18:0.155198 +100:gen_omp:1:18:0.170335 +100:gen_omp:1:18:0.192401 +100:gen_omp:1:18:0.223702 +100:gen_omp:1:18:0.155677 +100:gen_omp:1:18:0.149812 +100:gen_omp:1:18:0.177428 +100:gen_omp:1:18:0.155748 +100:gen_omp:1:18:0.155196 +100:gen_omp:1:18:0.151646 +100:gen_omp:1:18:0.187187 +100:gen_omp:1:18:0.196024 +1000:gen_omp:1:18:0.24362 +1000:gen_omp:1:18:0.232067 +1000:gen_omp:1:18:0.201636 +1000:gen_omp:1:18:0.262763 +1000:gen_omp:1:18:0.198602 +1000:gen_omp:1:18:0.238049 +1000:gen_omp:1:18:0.216305 +1000:gen_omp:1:18:0.255945 +1000:gen_omp:1:18:0.235835 +1000:gen_omp:1:18:0.251323 +1000:gen_omp:1:18:0.170512 +1000:gen_omp:1:18:0.172651 +1000:gen_omp:1:18:0.263396 +1000:gen_omp:1:18:0.215693 +1000:gen_omp:1:18:0.195811 +1000:gen_omp:1:18:0.28033 +1000:gen_omp:1:18:0.216287 +1000:gen_omp:1:18:0.169626 +1000:gen_omp:1:18:0.166316 +1000:gen_omp:1:18:0.187187 +10000:gen_omp:1:18:0.248588 +10000:gen_omp:1:18:0.318517 +10000:gen_omp:1:18:0.245235 +10000:gen_omp:1:18:0.221502 +10000:gen_omp:1:18:0.265488 +10000:gen_omp:1:18:0.295723 +10000:gen_omp:1:18:0.294038 +10000:gen_omp:1:18:0.272443 +10000:gen_omp:1:18:0.290815 +10000:gen_omp:1:18:0.294375 +10000:gen_omp:1:18:0.350139 +10000:gen_omp:1:18:0.366732 +10000:gen_omp:1:18:0.308887 +10000:gen_omp:1:18:0.365315 +10000:gen_omp:1:18:0.314213 +10000:gen_omp:1:18:0.240303 +10000:gen_omp:1:18:0.335517 +10000:gen_omp:1:18:0.268159 +10000:gen_omp:1:18:0.268843 +10000:gen_omp:1:18:0.217736 +100000:gen_omp:1:18:1.57743 +100000:gen_omp:1:18:1.45871 +100000:gen_omp:1:18:1.58249 +100000:gen_omp:1:18:1.42816 +100000:gen_omp:1:18:1.57213 +100000:gen_omp:1:18:1.39235 +100000:gen_omp:1:18:1.4395 +100000:gen_omp:1:18:1.50177 +100000:gen_omp:1:18:1.46607 +100000:gen_omp:1:18:1.41548 +100000:gen_omp:1:18:1.47304 +100000:gen_omp:1:18:1.38106 +100000:gen_omp:1:18:1.55191 +100000:gen_omp:1:18:1.49185 +100000:gen_omp:1:18:1.31416 +100000:gen_omp:1:18:1.26615 +100000:gen_omp:1:18:1.69331 +100000:gen_omp:1:18:1.58988 +100000:gen_omp:1:18:1.3137 +100000:gen_omp:1:18:1.29534 +1000000:gen_omp:1:18:7.55488 +1000000:gen_omp:1:18:7.03535 +1000000:gen_omp:1:18:6.72391 +1000000:gen_omp:1:18:7.12819 +1000000:gen_omp:1:18:6.71794 +1000000:gen_omp:1:18:6.92439 +1000000:gen_omp:1:18:7.08104 +1000000:gen_omp:1:18:7.48801 +1000000:gen_omp:1:18:6.98386 +1000000:gen_omp:1:18:7.35967 +1000000:gen_omp:1:18:6.79886 +1000000:gen_omp:1:18:6.98944 +1000000:gen_omp:1:18:7.23039 +1000000:gen_omp:1:18:6.97692 +1000000:gen_omp:1:18:7.30808 +1000000:gen_omp:1:18:6.87521 +1000000:gen_omp:1:18:7.26419 +1000000:gen_omp:1:18:6.80414 +1000000:gen_omp:1:18:7.35016 +1000000:gen_omp:1:18:7.06094 +10000000:gen_omp:1:18:70.7634 +10000000:gen_omp:1:18:70.4651 +10000000:gen_omp:1:18:70.7 +10000000:gen_omp:1:18:70.5081 +10000000:gen_omp:1:18:70.777 +10000000:gen_omp:1:18:70.6465 +10000000:gen_omp:1:18:70.3301 +10000000:gen_omp:1:18:70.4269 +10000000:gen_omp:1:18:70.4921 +10000000:gen_omp:1:18:70.5876 +10000000:gen_omp:1:18:70.728 +10000000:gen_omp:1:18:70.4422 +10000000:gen_omp:1:18:70.4989 +10000000:gen_omp:1:18:70.7994 +10000000:gen_omp:1:18:70.7858 +10000000:gen_omp:1:18:70.5721 +10000000:gen_omp:1:18:70.6735 +10000000:gen_omp:1:18:70.5154 +10000000:gen_omp:1:18:70.5079 +10000000:gen_omp:1:18:70.513 diff --git a/results/rt/data_basic/rt_size_18_gen_thread b/results/rt/data_basic/rt_size_18_gen_thread new file mode 100644 index 0000000..c5ceabe --- /dev/null +++ b/results/rt/data_basic/rt_size_18_gen_thread @@ -0,0 +1,120 @@ +100:gen_thread:1:18:0.892623 +100:gen_thread:1:18:1.02153 +100:gen_thread:1:18:1.01757 +100:gen_thread:1:18:1.03342 +100:gen_thread:1:18:1.05551 +100:gen_thread:1:18:0.967316 +100:gen_thread:1:18:0.885204 +100:gen_thread:1:18:0.972547 +100:gen_thread:1:18:1.04094 +100:gen_thread:1:18:1.02987 +100:gen_thread:1:18:0.874646 +100:gen_thread:1:18:0.855717 +100:gen_thread:1:18:0.955238 +100:gen_thread:1:18:1.06462 +100:gen_thread:1:18:0.920617 +100:gen_thread:1:18:0.858063 +100:gen_thread:1:18:1.01217 +100:gen_thread:1:18:1.00724 +100:gen_thread:1:18:0.86073 +100:gen_thread:1:18:0.868054 +1000:gen_thread:1:18:0.922695 +1000:gen_thread:1:18:0.948102 +1000:gen_thread:1:18:0.957823 +1000:gen_thread:1:18:0.896382 +1000:gen_thread:1:18:0.944464 +1000:gen_thread:1:18:1.00974 +1000:gen_thread:1:18:1.0289 +1000:gen_thread:1:18:0.94101 +1000:gen_thread:1:18:2.44571 +1000:gen_thread:1:18:0.91039 +1000:gen_thread:1:18:1.00864 +1000:gen_thread:1:18:0.968211 +1000:gen_thread:1:18:1.04018 +1000:gen_thread:1:18:0.95898 +1000:gen_thread:1:18:0.901808 +1000:gen_thread:1:18:0.818825 +1000:gen_thread:1:18:1.02713 +1000:gen_thread:1:18:1.03311 +1000:gen_thread:1:18:0.914098 +1000:gen_thread:1:18:0.965063 +10000:gen_thread:1:18:1.06591 +10000:gen_thread:1:18:0.973002 +10000:gen_thread:1:18:1.01131 +10000:gen_thread:1:18:2.61716 +10000:gen_thread:1:18:1.05679 +10000:gen_thread:1:18:0.937279 +10000:gen_thread:1:18:1.05616 +10000:gen_thread:1:18:1.00284 +10000:gen_thread:1:18:1.00852 +10000:gen_thread:1:18:1.01538 +10000:gen_thread:1:18:0.919305 +10000:gen_thread:1:18:1.04674 +10000:gen_thread:1:18:1.09 +10000:gen_thread:1:18:0.993154 +10000:gen_thread:1:18:0.912797 +10000:gen_thread:1:18:0.988165 +10000:gen_thread:1:18:1.04267 +10000:gen_thread:1:18:0.995957 +10000:gen_thread:1:18:0.951746 +10000:gen_thread:1:18:0.992837 +100000:gen_thread:1:18:1.55782 +100000:gen_thread:1:18:1.50607 +100000:gen_thread:1:18:1.51028 +100000:gen_thread:1:18:1.50838 +100000:gen_thread:1:18:1.51123 +100000:gen_thread:1:18:1.51576 +100000:gen_thread:1:18:1.51568 +100000:gen_thread:1:18:1.51592 +100000:gen_thread:1:18:1.51615 +100000:gen_thread:1:18:1.50211 +100000:gen_thread:1:18:1.52693 +100000:gen_thread:1:18:4.26978 +100000:gen_thread:1:18:1.67258 +100000:gen_thread:1:18:1.51485 +100000:gen_thread:1:18:1.5139 +100000:gen_thread:1:18:1.49544 +100000:gen_thread:1:18:1.52264 +100000:gen_thread:1:18:1.50541 +100000:gen_thread:1:18:1.51062 +100000:gen_thread:1:18:1.49916 +1000000:gen_thread:1:18:7.59217 +1000000:gen_thread:1:18:7.72625 +1000000:gen_thread:1:18:8.08988 +1000000:gen_thread:1:18:7.83876 +1000000:gen_thread:1:18:8.24828 +1000000:gen_thread:1:18:8.52138 +1000000:gen_thread:1:18:8.05682 +1000000:gen_thread:1:18:8.12113 +1000000:gen_thread:1:18:8.0451 +1000000:gen_thread:1:18:8.41238 +1000000:gen_thread:1:18:7.86397 +1000000:gen_thread:1:18:7.52013 +1000000:gen_thread:1:18:7.95345 +1000000:gen_thread:1:18:8.07165 +1000000:gen_thread:1:18:7.54312 +1000000:gen_thread:1:18:7.71293 +1000000:gen_thread:1:18:7.66235 +1000000:gen_thread:1:18:7.65845 +1000000:gen_thread:1:18:8.68028 +1000000:gen_thread:1:18:8.71861 +10000000:gen_thread:1:18:96.5234 +10000000:gen_thread:1:18:94.3285 +10000000:gen_thread:1:18:93.8896 +10000000:gen_thread:1:18:93.2062 +10000000:gen_thread:1:18:94.0314 +10000000:gen_thread:1:18:94.4278 +10000000:gen_thread:1:18:78.938 +10000000:gen_thread:1:18:96.3174 +10000000:gen_thread:1:18:93.8178 +10000000:gen_thread:1:18:91.7859 +10000000:gen_thread:1:18:95.6188 +10000000:gen_thread:1:18:94.9486 +10000000:gen_thread:1:18:93.469 +10000000:gen_thread:1:18:94.3145 +10000000:gen_thread:1:18:93.7497 +10000000:gen_thread:1:18:97.5609 +10000000:gen_thread:1:18:94.0693 +10000000:gen_thread:1:18:95.4233 +10000000:gen_thread:1:18:93.4823 +10000000:gen_thread:1:18:93.6501 diff --git a/results/rt/data_basic/rt_size_18_omp b/results/rt/data_basic/rt_size_18_omp new file mode 100644 index 0000000..987953f --- /dev/null +++ b/results/rt/data_basic/rt_size_18_omp @@ -0,0 +1,120 @@ +100:omp:1:18:0.242423 +100:omp:1:18:0.152658 +100:omp:1:18:0.218091 +100:omp:1:18:0.205155 +100:omp:1:18:0.208453 +100:omp:1:18:0.218468 +100:omp:1:18:0.204173 +100:omp:1:18:0.133625 +100:omp:1:18:0.225801 +100:omp:1:18:0.215233 +100:omp:1:18:0.158849 +100:omp:1:18:0.185199 +100:omp:1:18:0.231785 +100:omp:1:18:0.21479 +100:omp:1:18:0.149721 +100:omp:1:18:0.153095 +100:omp:1:18:0.15005 +100:omp:1:18:0.146939 +100:omp:1:18:0.187575 +100:omp:1:18:0.204981 +1000:omp:1:18:0.164636 +1000:omp:1:18:0.189802 +1000:omp:1:18:0.187256 +1000:omp:1:18:0.17371 +1000:omp:1:18:0.169052 +1000:omp:1:18:0.139108 +1000:omp:1:18:0.215171 +1000:omp:1:18:0.169384 +1000:omp:1:18:0.168748 +1000:omp:1:18:0.165036 +1000:omp:1:18:0.165275 +1000:omp:1:18:0.165091 +1000:omp:1:18:0.189707 +1000:omp:1:18:0.165119 +1000:omp:1:18:0.166303 +1000:omp:1:18:0.216645 +1000:omp:1:18:0.249752 +1000:omp:1:18:0.21707 +1000:omp:1:18:0.210199 +1000:omp:1:18:0.257933 +10000:omp:1:18:0.249163 +10000:omp:1:18:0.262282 +10000:omp:1:18:0.367587 +10000:omp:1:18:0.29402 +10000:omp:1:18:0.341475 +10000:omp:1:18:0.255485 +10000:omp:1:18:0.367015 +10000:omp:1:18:0.282886 +10000:omp:1:18:0.326785 +10000:omp:1:18:0.292443 +10000:omp:1:18:0.254534 +10000:omp:1:18:0.261227 +10000:omp:1:18:0.208317 +10000:omp:1:18:0.269268 +10000:omp:1:18:0.282208 +10000:omp:1:18:0.254435 +10000:omp:1:18:0.242716 +10000:omp:1:18:0.294681 +10000:omp:1:18:0.379574 +10000:omp:1:18:0.285444 +100000:omp:1:18:1.29633 +100000:omp:1:18:1.27861 +100000:omp:1:18:1.2467 +100000:omp:1:18:1.19203 +100000:omp:1:18:1.27406 +100000:omp:1:18:1.36235 +100000:omp:1:18:1.33691 +100000:omp:1:18:1.34699 +100000:omp:1:18:1.29037 +100000:omp:1:18:1.14634 +100000:omp:1:18:1.51438 +100000:omp:1:18:1.33102 +100000:omp:1:18:1.43725 +100000:omp:1:18:0.940192 +100000:omp:1:18:1.14164 +100000:omp:1:18:1.55154 +100000:omp:1:18:1.40322 +100000:omp:1:18:1.2393 +100000:omp:1:18:1.44217 +100000:omp:1:18:1.13643 +1000000:omp:1:18:7.19116 +1000000:omp:1:18:6.69684 +1000000:omp:1:18:6.49815 +1000000:omp:1:18:6.15961 +1000000:omp:1:18:6.32768 +1000000:omp:1:18:6.83488 +1000000:omp:1:18:6.26427 +1000000:omp:1:18:6.68138 +1000000:omp:1:18:6.7569 +1000000:omp:1:18:6.7644 +1000000:omp:1:18:6.32671 +1000000:omp:1:18:6.6498 +1000000:omp:1:18:6.35439 +1000000:omp:1:18:6.66318 +1000000:omp:1:18:6.42151 +1000000:omp:1:18:6.68428 +1000000:omp:1:18:6.88014 +1000000:omp:1:18:6.55917 +1000000:omp:1:18:6.90806 +1000000:omp:1:18:6.78894 +10000000:omp:1:18:66.3726 +10000000:omp:1:18:66.5035 +10000000:omp:1:18:66.3493 +10000000:omp:1:18:66.1746 +10000000:omp:1:18:66.5425 +10000000:omp:1:18:66.5358 +10000000:omp:1:18:66.7964 +10000000:omp:1:18:66.4206 +10000000:omp:1:18:66.701 +10000000:omp:1:18:67.1176 +10000000:omp:1:18:66.5275 +10000000:omp:1:18:66.6285 +10000000:omp:1:18:66.4525 +10000000:omp:1:18:66.473 +10000000:omp:1:18:66.3471 +10000000:omp:1:18:66.5749 +10000000:omp:1:18:66.494 +10000000:omp:1:18:66.4199 +10000000:omp:1:18:66.465 +10000000:omp:1:18:66.6305 diff --git a/results/rt/data_basic/rt_size_18_seq b/results/rt/data_basic/rt_size_18_seq new file mode 100644 index 0000000..b297eab --- /dev/null +++ b/results/rt/data_basic/rt_size_18_seq @@ -0,0 +1,120 @@ +100:seq:1:18:0.000557 +100:seq:1:18:0.000517 +100:seq:1:18:0.00053 +100:seq:1:18:0.000564 +100:seq:1:18:0.000518 +100:seq:1:18:0.000534 +100:seq:1:18:0.000518 +100:seq:1:18:0.000518 +100:seq:1:18:0.000531 +100:seq:1:18:0.000518 +100:seq:1:18:0.000528 +100:seq:1:18:0.000518 +100:seq:1:18:0.000518 +100:seq:1:18:0.000519 +100:seq:1:18:0.000533 +100:seq:1:18:0.000521 +100:seq:1:18:0.000533 +100:seq:1:18:0.000531 +100:seq:1:18:0.000523 +100:seq:1:18:0.000532 +1000:seq:1:18:0.004837 +1000:seq:1:18:0.004835 +1000:seq:1:18:0.004846 +1000:seq:1:18:0.004839 +1000:seq:1:18:0.004832 +1000:seq:1:18:0.004842 +1000:seq:1:18:0.004835 +1000:seq:1:18:0.004852 +1000:seq:1:18:0.004841 +1000:seq:1:18:0.004839 +1000:seq:1:18:0.004841 +1000:seq:1:18:0.004582 +1000:seq:1:18:0.004575 +1000:seq:1:18:0.004571 +1000:seq:1:18:0.004329 +1000:seq:1:18:0.004326 +1000:seq:1:18:0.004105 +1000:seq:1:18:0.003907 +1000:seq:1:18:0.00392 +1000:seq:1:18:0.003902 +10000:seq:1:18:0.037077 +10000:seq:1:18:0.030116 +10000:seq:1:18:0.025448 +10000:seq:1:18:0.025507 +10000:seq:1:18:0.025464 +10000:seq:1:18:0.025461 +10000:seq:1:18:0.025452 +10000:seq:1:18:0.02552 +10000:seq:1:18:0.025362 +10000:seq:1:18:0.025446 +10000:seq:1:18:0.025482 +10000:seq:1:18:0.025445 +10000:seq:1:18:0.025455 +10000:seq:1:18:0.025374 +10000:seq:1:18:0.025482 +10000:seq:1:18:0.025476 +10000:seq:1:18:0.025446 +10000:seq:1:18:0.025502 +10000:seq:1:18:0.025498 +10000:seq:1:18:0.025447 +100000:seq:1:18:0.546766 +100000:seq:1:18:0.533864 +100000:seq:1:18:0.54685 +100000:seq:1:18:0.533879 +100000:seq:1:18:0.546716 +100000:seq:1:18:0.533942 +100000:seq:1:18:0.534432 +100000:seq:1:18:0.534256 +100000:seq:1:18:0.533657 +100000:seq:1:18:0.536697 +100000:seq:1:18:0.534297 +100000:seq:1:18:0.527449 +100000:seq:1:18:0.532358 +100000:seq:1:18:0.537178 +100000:seq:1:18:0.544745 +100000:seq:1:18:0.53348 +100000:seq:1:18:0.539886 +100000:seq:1:18:0.534334 +100000:seq:1:18:0.549991 +100000:seq:1:18:0.535913 +1000000:seq:1:18:5.42276 +1000000:seq:1:18:5.40007 +1000000:seq:1:18:5.39245 +1000000:seq:1:18:5.4037 +1000000:seq:1:18:5.373 +1000000:seq:1:18:5.40895 +1000000:seq:1:18:5.39323 +1000000:seq:1:18:5.4186 +1000000:seq:1:18:5.38499 +1000000:seq:1:18:5.39988 +1000000:seq:1:18:5.41296 +1000000:seq:1:18:5.37339 +1000000:seq:1:18:5.40622 +1000000:seq:1:18:5.38832 +1000000:seq:1:18:5.37783 +1000000:seq:1:18:5.37077 +1000000:seq:1:18:5.40269 +1000000:seq:1:18:5.3804 +1000000:seq:1:18:5.39082 +1000000:seq:1:18:5.37035 +10000000:seq:1:18:61.2607 +10000000:seq:1:18:61.3602 +10000000:seq:1:18:61.2622 +10000000:seq:1:18:61.3079 +10000000:seq:1:18:61.3105 +10000000:seq:1:18:61.348 +10000000:seq:1:18:61.3069 +10000000:seq:1:18:61.2971 +10000000:seq:1:18:61.3185 +10000000:seq:1:18:61.3021 +10000000:seq:1:18:61.2354 +10000000:seq:1:18:61.3573 +10000000:seq:1:18:61.2608 +10000000:seq:1:18:61.3224 +10000000:seq:1:18:61.3128 +10000000:seq:1:18:61.3068 +10000000:seq:1:18:61.2811 +10000000:seq:1:18:61.3305 +10000000:seq:1:18:61.2874 +10000000:seq:1:18:61.2838 diff --git a/results/rt/data_basic/rt_size_1_gen_omp b/results/rt/data_basic/rt_size_1_gen_omp new file mode 100644 index 0000000..06d01d5 --- /dev/null +++ b/results/rt/data_basic/rt_size_1_gen_omp @@ -0,0 +1,120 @@ +100:gen_omp:1:1:0.001014 +100:gen_omp:1:1:0.00076 +100:gen_omp:1:1:0.000771 +100:gen_omp:1:1:0.000801 +100:gen_omp:1:1:0.000771 +100:gen_omp:1:1:0.000769 +100:gen_omp:1:1:0.000794 +100:gen_omp:1:1:0.00078 +100:gen_omp:1:1:0.00078 +100:gen_omp:1:1:0.000779 +100:gen_omp:1:1:0.000762 +100:gen_omp:1:1:0.000807 +100:gen_omp:1:1:0.000768 +100:gen_omp:1:1:0.000767 +100:gen_omp:1:1:0.000771 +100:gen_omp:1:1:0.000763 +100:gen_omp:1:1:0.000796 +100:gen_omp:1:1:0.000761 +100:gen_omp:1:1:0.000779 +100:gen_omp:1:1:0.000763 +1000:gen_omp:1:1:0.003994 +1000:gen_omp:1:1:0.003898 +1000:gen_omp:1:1:0.003905 +1000:gen_omp:1:1:0.003907 +1000:gen_omp:1:1:0.003933 +1000:gen_omp:1:1:0.003942 +1000:gen_omp:1:1:0.004039 +1000:gen_omp:1:1:0.003919 +1000:gen_omp:1:1:0.003966 +1000:gen_omp:1:1:0.004008 +1000:gen_omp:1:1:0.003913 +1000:gen_omp:1:1:0.003953 +1000:gen_omp:1:1:0.003923 +1000:gen_omp:1:1:0.003905 +1000:gen_omp:1:1:0.0039 +1000:gen_omp:1:1:0.003893 +1000:gen_omp:1:1:0.004039 +1000:gen_omp:1:1:0.003903 +1000:gen_omp:1:1:0.003901 +1000:gen_omp:1:1:0.003912 +10000:gen_omp:1:1:0.034988 +10000:gen_omp:1:1:0.034974 +10000:gen_omp:1:1:0.035064 +10000:gen_omp:1:1:0.034992 +10000:gen_omp:1:1:0.0347 +10000:gen_omp:1:1:0.034824 +10000:gen_omp:1:1:0.034771 +10000:gen_omp:1:1:0.03509 +10000:gen_omp:1:1:0.034875 +10000:gen_omp:1:1:0.034813 +10000:gen_omp:1:1:0.034883 +10000:gen_omp:1:1:0.034893 +10000:gen_omp:1:1:0.035062 +10000:gen_omp:1:1:0.03513 +10000:gen_omp:1:1:0.034941 +10000:gen_omp:1:1:0.034835 +10000:gen_omp:1:1:0.034987 +10000:gen_omp:1:1:0.075015 +10000:gen_omp:1:1:0.07505 +10000:gen_omp:1:1:0.056021 +100000:gen_omp:1:1:0.616002 +100000:gen_omp:1:1:0.599163 +100000:gen_omp:1:1:0.615122 +100000:gen_omp:1:1:0.598207 +100000:gen_omp:1:1:0.611761 +100000:gen_omp:1:1:0.597909 +100000:gen_omp:1:1:0.615206 +100000:gen_omp:1:1:0.596296 +100000:gen_omp:1:1:0.609872 +100000:gen_omp:1:1:0.601992 +100000:gen_omp:1:1:0.615881 +100000:gen_omp:1:1:0.597437 +100000:gen_omp:1:1:0.596932 +100000:gen_omp:1:1:0.600755 +100000:gen_omp:1:1:0.605613 +100000:gen_omp:1:1:0.601742 +100000:gen_omp:1:1:0.603346 +100000:gen_omp:1:1:0.599382 +100000:gen_omp:1:1:0.600752 +100000:gen_omp:1:1:0.598555 +1000000:gen_omp:1:1:6.14945 +1000000:gen_omp:1:1:6.12154 +1000000:gen_omp:1:1:6.07773 +1000000:gen_omp:1:1:6.11655 +1000000:gen_omp:1:1:6.0754 +1000000:gen_omp:1:1:6.09614 +1000000:gen_omp:1:1:6.07218 +1000000:gen_omp:1:1:6.1097 +1000000:gen_omp:1:1:6.0679 +1000000:gen_omp:1:1:6.06303 +1000000:gen_omp:1:1:6.01524 +1000000:gen_omp:1:1:6.07615 +1000000:gen_omp:1:1:6.06079 +1000000:gen_omp:1:1:5.98695 +1000000:gen_omp:1:1:6.09853 +1000000:gen_omp:1:1:6.05256 +1000000:gen_omp:1:1:6.03252 +1000000:gen_omp:1:1:6.13134 +1000000:gen_omp:1:1:6.00856 +1000000:gen_omp:1:1:6.06845 +10000000:gen_omp:1:1:66.503 +10000000:gen_omp:1:1:66.5176 +10000000:gen_omp:1:1:66.5567 +10000000:gen_omp:1:1:66.5538 +10000000:gen_omp:1:1:66.4919 +10000000:gen_omp:1:1:66.4304 +10000000:gen_omp:1:1:66.4875 +10000000:gen_omp:1:1:66.571 +10000000:gen_omp:1:1:66.5096 +10000000:gen_omp:1:1:66.5313 +10000000:gen_omp:1:1:66.4105 +10000000:gen_omp:1:1:66.5015 +10000000:gen_omp:1:1:66.4283 +10000000:gen_omp:1:1:66.4551 +10000000:gen_omp:1:1:66.4796 +10000000:gen_omp:1:1:66.5739 +10000000:gen_omp:1:1:66.4471 +10000000:gen_omp:1:1:66.4777 +10000000:gen_omp:1:1:66.4303 +10000000:gen_omp:1:1:66.4999 diff --git a/results/rt/data_basic/rt_size_1_gen_thread b/results/rt/data_basic/rt_size_1_gen_thread new file mode 100644 index 0000000..96f9a78 --- /dev/null +++ b/results/rt/data_basic/rt_size_1_gen_thread @@ -0,0 +1,120 @@ +100:gen_thread:1:1:0.000401 +100:gen_thread:1:1:0.00037 +100:gen_thread:1:1:0.000381 +100:gen_thread:1:1:0.000375 +100:gen_thread:1:1:0.000369 +100:gen_thread:1:1:0.00037 +100:gen_thread:1:1:0.000379 +100:gen_thread:1:1:0.00039 +100:gen_thread:1:1:0.000375 +100:gen_thread:1:1:0.000371 +100:gen_thread:1:1:0.000369 +100:gen_thread:1:1:0.000374 +100:gen_thread:1:1:0.000371 +100:gen_thread:1:1:0.000369 +100:gen_thread:1:1:0.000368 +100:gen_thread:1:1:0.00037 +100:gen_thread:1:1:0.000376 +100:gen_thread:1:1:0.000382 +100:gen_thread:1:1:0.000371 +100:gen_thread:1:1:0.000373 +1000:gen_thread:1:1:0.003486 +1000:gen_thread:1:1:0.003411 +1000:gen_thread:1:1:0.003413 +1000:gen_thread:1:1:0.003412 +1000:gen_thread:1:1:0.003417 +1000:gen_thread:1:1:0.003422 +1000:gen_thread:1:1:0.003418 +1000:gen_thread:1:1:0.003429 +1000:gen_thread:1:1:0.003429 +1000:gen_thread:1:1:0.003422 +1000:gen_thread:1:1:0.003426 +1000:gen_thread:1:1:0.003425 +1000:gen_thread:1:1:0.003419 +1000:gen_thread:1:1:0.003418 +1000:gen_thread:1:1:0.00342 +1000:gen_thread:1:1:0.003494 +1000:gen_thread:1:1:0.00347 +1000:gen_thread:1:1:0.003463 +1000:gen_thread:1:1:0.003473 +1000:gen_thread:1:1:0.00347 +10000:gen_thread:1:1:0.033998 +10000:gen_thread:1:1:0.03401 +10000:gen_thread:1:1:0.034104 +10000:gen_thread:1:1:0.034029 +10000:gen_thread:1:1:0.034022 +10000:gen_thread:1:1:0.034012 +10000:gen_thread:1:1:0.034099 +10000:gen_thread:1:1:0.03401 +10000:gen_thread:1:1:0.034026 +10000:gen_thread:1:1:0.034039 +10000:gen_thread:1:1:0.034078 +10000:gen_thread:1:1:0.033998 +10000:gen_thread:1:1:0.03412 +10000:gen_thread:1:1:0.034004 +10000:gen_thread:1:1:0.034061 +10000:gen_thread:1:1:0.033981 +10000:gen_thread:1:1:0.033998 +10000:gen_thread:1:1:0.034243 +10000:gen_thread:1:1:0.034018 +10000:gen_thread:1:1:0.03404 +100000:gen_thread:1:1:0.606383 +100000:gen_thread:1:1:0.599608 +100000:gen_thread:1:1:0.605264 +100000:gen_thread:1:1:0.599219 +100000:gen_thread:1:1:0.606717 +100000:gen_thread:1:1:0.600285 +100000:gen_thread:1:1:0.595346 +100000:gen_thread:1:1:0.59919 +100000:gen_thread:1:1:0.597221 +100000:gen_thread:1:1:0.599388 +100000:gen_thread:1:1:0.599151 +100000:gen_thread:1:1:0.604454 +100000:gen_thread:1:1:0.594519 +100000:gen_thread:1:1:0.598494 +100000:gen_thread:1:1:0.593566 +100000:gen_thread:1:1:0.604107 +100000:gen_thread:1:1:0.599624 +100000:gen_thread:1:1:0.604364 +100000:gen_thread:1:1:0.600408 +100000:gen_thread:1:1:0.599047 +1000000:gen_thread:1:1:5.99475 +1000000:gen_thread:1:1:5.97356 +1000000:gen_thread:1:1:6.04875 +1000000:gen_thread:1:1:5.98287 +1000000:gen_thread:1:1:6.00091 +1000000:gen_thread:1:1:5.9922 +1000000:gen_thread:1:1:5.99761 +1000000:gen_thread:1:1:6.00362 +1000000:gen_thread:1:1:5.99313 +1000000:gen_thread:1:1:5.96564 +1000000:gen_thread:1:1:6.04297 +1000000:gen_thread:1:1:6.03133 +1000000:gen_thread:1:1:5.98683 +1000000:gen_thread:1:1:5.98482 +1000000:gen_thread:1:1:6.01311 +1000000:gen_thread:1:1:5.97628 +1000000:gen_thread:1:1:6.0119 +1000000:gen_thread:1:1:5.97123 +1000000:gen_thread:1:1:5.99415 +1000000:gen_thread:1:1:6.00002 +10000000:gen_thread:1:1:66.1755 +10000000:gen_thread:1:1:66.3491 +10000000:gen_thread:1:1:66.2898 +10000000:gen_thread:1:1:66.2409 +10000000:gen_thread:1:1:66.2873 +10000000:gen_thread:1:1:66.1895 +10000000:gen_thread:1:1:66.2124 +10000000:gen_thread:1:1:66.0299 +10000000:gen_thread:1:1:66.1569 +10000000:gen_thread:1:1:66.2016 +10000000:gen_thread:1:1:66.3281 +10000000:gen_thread:1:1:66.4048 +10000000:gen_thread:1:1:66.2587 +10000000:gen_thread:1:1:66.1486 +10000000:gen_thread:1:1:66.272 +10000000:gen_thread:1:1:66.2351 +10000000:gen_thread:1:1:66.2392 +10000000:gen_thread:1:1:66.2333 +10000000:gen_thread:1:1:66.3886 +10000000:gen_thread:1:1:66.1761 diff --git a/results/rt/data_basic/rt_size_1_omp b/results/rt/data_basic/rt_size_1_omp new file mode 100644 index 0000000..33c4158 --- /dev/null +++ b/results/rt/data_basic/rt_size_1_omp @@ -0,0 +1,120 @@ +100:omp:1:1:0.000664 +100:omp:1:1:0.000658 +100:omp:1:1:0.000709 +100:omp:1:1:0.000657 +100:omp:1:1:0.000666 +100:omp:1:1:0.000665 +100:omp:1:1:0.000656 +100:omp:1:1:0.000687 +100:omp:1:1:0.000655 +100:omp:1:1:0.000656 +100:omp:1:1:0.000687 +100:omp:1:1:0.000653 +100:omp:1:1:0.000663 +100:omp:1:1:0.000673 +100:omp:1:1:0.000656 +100:omp:1:1:0.000699 +100:omp:1:1:0.000655 +100:omp:1:1:0.000662 +100:omp:1:1:0.000673 +100:omp:1:1:0.000662 +1000:omp:1:1:0.002995 +1000:omp:1:1:0.003005 +1000:omp:1:1:0.002933 +1000:omp:1:1:0.002934 +1000:omp:1:1:0.00296 +1000:omp:1:1:0.00295 +1000:omp:1:1:0.003014 +1000:omp:1:1:0.003018 +1000:omp:1:1:0.003016 +1000:omp:1:1:0.00295 +1000:omp:1:1:0.002946 +1000:omp:1:1:0.002947 +1000:omp:1:1:0.002973 +1000:omp:1:1:0.002956 +1000:omp:1:1:0.002945 +1000:omp:1:1:0.003024 +1000:omp:1:1:0.003017 +1000:omp:1:1:0.002966 +1000:omp:1:1:0.002938 +1000:omp:1:1:0.00294 +10000:omp:1:1:0.025623 +10000:omp:1:1:0.025624 +10000:omp:1:1:0.025728 +10000:omp:1:1:0.025723 +10000:omp:1:1:0.025762 +10000:omp:1:1:0.025701 +10000:omp:1:1:0.025646 +10000:omp:1:1:0.025655 +10000:omp:1:1:0.025634 +10000:omp:1:1:0.025837 +10000:omp:1:1:0.02571 +10000:omp:1:1:0.025712 +10000:omp:1:1:0.025568 +10000:omp:1:1:0.025719 +10000:omp:1:1:0.025688 +10000:omp:1:1:0.025815 +10000:omp:1:1:0.025577 +10000:omp:1:1:0.02572 +10000:omp:1:1:0.025579 +10000:omp:1:1:0.025585 +100000:omp:1:1:0.535994 +100000:omp:1:1:0.540766 +100000:omp:1:1:0.536306 +100000:omp:1:1:0.536992 +100000:omp:1:1:0.53607 +100000:omp:1:1:0.539847 +100000:omp:1:1:0.53427 +100000:omp:1:1:0.542608 +100000:omp:1:1:0.546122 +100000:omp:1:1:0.53356 +100000:omp:1:1:0.541434 +100000:omp:1:1:0.550877 +100000:omp:1:1:0.547861 +100000:omp:1:1:0.543036 +100000:omp:1:1:0.537781 +100000:omp:1:1:0.539528 +100000:omp:1:1:0.542186 +100000:omp:1:1:0.536754 +100000:omp:1:1:0.538403 +100000:omp:1:1:0.540259 +1000000:omp:1:1:5.41292 +1000000:omp:1:1:5.4028 +1000000:omp:1:1:5.4111 +1000000:omp:1:1:5.38537 +1000000:omp:1:1:5.41074 +1000000:omp:1:1:5.41933 +1000000:omp:1:1:5.37753 +1000000:omp:1:1:5.41287 +1000000:omp:1:1:5.38494 +1000000:omp:1:1:5.42803 +1000000:omp:1:1:5.38714 +1000000:omp:1:1:5.40449 +1000000:omp:1:1:5.387 +1000000:omp:1:1:5.38087 +1000000:omp:1:1:5.39139 +1000000:omp:1:1:5.3834 +1000000:omp:1:1:5.39418 +1000000:omp:1:1:5.40052 +1000000:omp:1:1:5.37981 +1000000:omp:1:1:5.39614 +10000000:omp:1:1:61.1503 +10000000:omp:1:1:61.167 +10000000:omp:1:1:61.3045 +10000000:omp:1:1:61.2185 +10000000:omp:1:1:61.3023 +10000000:omp:1:1:61.1067 +10000000:omp:1:1:61.3007 +10000000:omp:1:1:61.169 +10000000:omp:1:1:61.2139 +10000000:omp:1:1:61.1539 +10000000:omp:1:1:61.3214 +10000000:omp:1:1:61.2316 +10000000:omp:1:1:61.1584 +10000000:omp:1:1:61.2205 +10000000:omp:1:1:61.2184 +10000000:omp:1:1:61.3025 +10000000:omp:1:1:61.3412 +10000000:omp:1:1:61.2543 +10000000:omp:1:1:61.2768 +10000000:omp:1:1:61.2461 diff --git a/results/rt/data_basic/rt_size_1_seq b/results/rt/data_basic/rt_size_1_seq new file mode 100644 index 0000000..add3b2a --- /dev/null +++ b/results/rt/data_basic/rt_size_1_seq @@ -0,0 +1,120 @@ +100:seq:1:1:0.000696 +100:seq:1:1:0.000655 +100:seq:1:1:0.000608 +100:seq:1:1:0.000598 +100:seq:1:1:0.000608 +100:seq:1:1:0.000607 +100:seq:1:1:0.000605 +100:seq:1:1:0.000592 +100:seq:1:1:0.000593 +100:seq:1:1:0.000556 +100:seq:1:1:0.000582 +100:seq:1:1:0.000569 +100:seq:1:1:0.000572 +100:seq:1:1:0.000564 +100:seq:1:1:0.000568 +100:seq:1:1:0.000556 +100:seq:1:1:0.000564 +100:seq:1:1:0.000522 +100:seq:1:1:0.000534 +100:seq:1:1:0.000522 +1000:seq:1:1:0.005143 +1000:seq:1:1:0.005133 +1000:seq:1:1:0.005125 +1000:seq:1:1:0.005137 +1000:seq:1:1:0.00514 +1000:seq:1:1:0.005149 +1000:seq:1:1:0.005141 +1000:seq:1:1:0.005149 +1000:seq:1:1:0.005139 +1000:seq:1:1:0.005146 +1000:seq:1:1:0.005147 +1000:seq:1:1:0.004846 +1000:seq:1:1:0.004843 +1000:seq:1:1:0.004829 +1000:seq:1:1:0.004832 +1000:seq:1:1:0.004847 +1000:seq:1:1:0.004833 +1000:seq:1:1:0.004844 +1000:seq:1:1:0.004832 +1000:seq:1:1:0.00484 +10000:seq:1:1:0.043812 +10000:seq:1:1:0.038323 +10000:seq:1:1:0.035265 +10000:seq:1:1:0.027229 +10000:seq:1:1:0.025488 +10000:seq:1:1:0.025605 +10000:seq:1:1:0.025713 +10000:seq:1:1:0.025632 +10000:seq:1:1:0.025613 +10000:seq:1:1:0.02561 +10000:seq:1:1:0.025523 +10000:seq:1:1:0.025466 +10000:seq:1:1:0.025672 +10000:seq:1:1:0.0257 +10000:seq:1:1:0.025563 +10000:seq:1:1:0.025615 +10000:seq:1:1:0.025549 +10000:seq:1:1:0.025609 +10000:seq:1:1:0.025671 +10000:seq:1:1:0.025661 +100000:seq:1:1:0.53523 +100000:seq:1:1:0.537863 +100000:seq:1:1:0.535211 +100000:seq:1:1:0.538299 +100000:seq:1:1:0.536152 +100000:seq:1:1:0.535243 +100000:seq:1:1:0.533021 +100000:seq:1:1:0.533714 +100000:seq:1:1:0.53772 +100000:seq:1:1:0.535788 +100000:seq:1:1:0.535566 +100000:seq:1:1:0.537626 +100000:seq:1:1:0.537716 +100000:seq:1:1:0.536711 +100000:seq:1:1:0.53352 +100000:seq:1:1:0.537332 +100000:seq:1:1:0.535164 +100000:seq:1:1:0.545718 +100000:seq:1:1:0.531649 +100000:seq:1:1:0.543979 +1000000:seq:1:1:5.39756 +1000000:seq:1:1:5.36787 +1000000:seq:1:1:5.39786 +1000000:seq:1:1:5.39994 +1000000:seq:1:1:5.39503 +1000000:seq:1:1:5.40046 +1000000:seq:1:1:5.39416 +1000000:seq:1:1:5.39358 +1000000:seq:1:1:5.38088 +1000000:seq:1:1:5.3959 +1000000:seq:1:1:5.41432 +1000000:seq:1:1:5.40733 +1000000:seq:1:1:5.3934 +1000000:seq:1:1:5.39632 +1000000:seq:1:1:5.38775 +1000000:seq:1:1:5.39776 +1000000:seq:1:1:5.39187 +1000000:seq:1:1:5.39886 +1000000:seq:1:1:5.3716 +1000000:seq:1:1:5.42044 +10000000:seq:1:1:61.2942 +10000000:seq:1:1:61.2475 +10000000:seq:1:1:61.2943 +10000000:seq:1:1:61.2891 +10000000:seq:1:1:61.2638 +10000000:seq:1:1:61.2413 +10000000:seq:1:1:61.1324 +10000000:seq:1:1:61.2304 +10000000:seq:1:1:61.2153 +10000000:seq:1:1:61.3166 +10000000:seq:1:1:61.2893 +10000000:seq:1:1:61.302 +10000000:seq:1:1:61.2162 +10000000:seq:1:1:61.314 +10000000:seq:1:1:61.3092 +10000000:seq:1:1:61.2832 +10000000:seq:1:1:61.2989 +10000000:seq:1:1:61.3249 +10000000:seq:1:1:61.2219 +10000000:seq:1:1:61.3273 diff --git a/results/rt/data_basic/rt_size_2_gen_omp b/results/rt/data_basic/rt_size_2_gen_omp new file mode 100644 index 0000000..d35d3b4 --- /dev/null +++ b/results/rt/data_basic/rt_size_2_gen_omp @@ -0,0 +1,120 @@ +100:gen_omp:1:2:0.015725 +100:gen_omp:1:2:0.01757 +100:gen_omp:1:2:0.017013 +100:gen_omp:1:2:0.015901 +100:gen_omp:1:2:0.01459 +100:gen_omp:1:2:0.015559 +100:gen_omp:1:2:0.015972 +100:gen_omp:1:2:0.015585 +100:gen_omp:1:2:0.015111 +100:gen_omp:1:2:0.015809 +100:gen_omp:1:2:0.0153 +100:gen_omp:1:2:0.015658 +100:gen_omp:1:2:0.015138 +100:gen_omp:1:2:0.014032 +100:gen_omp:1:2:0.016373 +100:gen_omp:1:2:0.015764 +100:gen_omp:1:2:0.015565 +100:gen_omp:1:2:0.01446 +100:gen_omp:1:2:0.014176 +100:gen_omp:1:2:0.013789 +1000:gen_omp:1:2:0.016545 +1000:gen_omp:1:2:0.017455 +1000:gen_omp:1:2:0.015904 +1000:gen_omp:1:2:0.016125 +1000:gen_omp:1:2:0.016577 +1000:gen_omp:1:2:0.016413 +1000:gen_omp:1:2:0.016674 +1000:gen_omp:1:2:0.01671 +1000:gen_omp:1:2:0.015841 +1000:gen_omp:1:2:0.016538 +1000:gen_omp:1:2:0.016286 +1000:gen_omp:1:2:0.017512 +1000:gen_omp:1:2:0.017701 +1000:gen_omp:1:2:0.017415 +1000:gen_omp:1:2:0.018079 +1000:gen_omp:1:2:0.016811 +1000:gen_omp:1:2:0.017053 +1000:gen_omp:1:2:0.016411 +1000:gen_omp:1:2:0.017621 +1000:gen_omp:1:2:0.016611 +10000:gen_omp:1:2:0.069344 +10000:gen_omp:1:2:0.063894 +10000:gen_omp:1:2:0.0599 +10000:gen_omp:1:2:0.052782 +10000:gen_omp:1:2:0.045495 +10000:gen_omp:1:2:0.04604 +10000:gen_omp:1:2:0.045367 +10000:gen_omp:1:2:0.04528 +10000:gen_omp:1:2:0.045747 +10000:gen_omp:1:2:0.045396 +10000:gen_omp:1:2:0.045534 +10000:gen_omp:1:2:0.045721 +10000:gen_omp:1:2:0.044706 +10000:gen_omp:1:2:0.045533 +10000:gen_omp:1:2:0.04528 +10000:gen_omp:1:2:0.045425 +10000:gen_omp:1:2:0.04517 +10000:gen_omp:1:2:0.04492 +10000:gen_omp:1:2:0.045964 +10000:gen_omp:1:2:0.045063 +100000:gen_omp:1:2:0.61864 +100000:gen_omp:1:2:0.627195 +100000:gen_omp:1:2:0.610839 +100000:gen_omp:1:2:0.627354 +100000:gen_omp:1:2:0.618874 +100000:gen_omp:1:2:0.620149 +100000:gen_omp:1:2:0.618186 +100000:gen_omp:1:2:0.619437 +100000:gen_omp:1:2:0.622293 +100000:gen_omp:1:2:0.624625 +100000:gen_omp:1:2:0.625712 +100000:gen_omp:1:2:0.614837 +100000:gen_omp:1:2:0.648125 +100000:gen_omp:1:2:0.623747 +100000:gen_omp:1:2:0.62517 +100000:gen_omp:1:2:0.626365 +100000:gen_omp:1:2:0.638706 +100000:gen_omp:1:2:0.62659 +100000:gen_omp:1:2:0.625124 +100000:gen_omp:1:2:0.619802 +1000000:gen_omp:1:2:6.2059 +1000000:gen_omp:1:2:6.14752 +1000000:gen_omp:1:2:6.10729 +1000000:gen_omp:1:2:6.07653 +1000000:gen_omp:1:2:6.17774 +1000000:gen_omp:1:2:6.12243 +1000000:gen_omp:1:2:6.13276 +1000000:gen_omp:1:2:6.13942 +1000000:gen_omp:1:2:6.15378 +1000000:gen_omp:1:2:6.14388 +1000000:gen_omp:1:2:6.15719 +1000000:gen_omp:1:2:6.15564 +1000000:gen_omp:1:2:6.17263 +1000000:gen_omp:1:2:6.14191 +1000000:gen_omp:1:2:6.2114 +1000000:gen_omp:1:2:6.09293 +1000000:gen_omp:1:2:6.12061 +1000000:gen_omp:1:2:6.17199 +1000000:gen_omp:1:2:6.19209 +1000000:gen_omp:1:2:6.20168 +10000000:gen_omp:1:2:67.0324 +10000000:gen_omp:1:2:66.9617 +10000000:gen_omp:1:2:66.8255 +10000000:gen_omp:1:2:66.9489 +10000000:gen_omp:1:2:66.86 +10000000:gen_omp:1:2:66.9868 +10000000:gen_omp:1:2:67.089 +10000000:gen_omp:1:2:66.8125 +10000000:gen_omp:1:2:66.9235 +10000000:gen_omp:1:2:66.8378 +10000000:gen_omp:1:2:67.0015 +10000000:gen_omp:1:2:66.9121 +10000000:gen_omp:1:2:66.9285 +10000000:gen_omp:1:2:66.9944 +10000000:gen_omp:1:2:66.8868 +10000000:gen_omp:1:2:66.8766 +10000000:gen_omp:1:2:66.9761 +10000000:gen_omp:1:2:66.8419 +10000000:gen_omp:1:2:66.9947 +10000000:gen_omp:1:2:66.7674 diff --git a/results/rt/data_basic/rt_size_2_gen_thread b/results/rt/data_basic/rt_size_2_gen_thread new file mode 100644 index 0000000..8cf0727 --- /dev/null +++ b/results/rt/data_basic/rt_size_2_gen_thread @@ -0,0 +1,120 @@ +100:gen_thread:1:2:0.037896 +100:gen_thread:1:2:0.03822 +100:gen_thread:1:2:0.037813 +100:gen_thread:1:2:0.038167 +100:gen_thread:1:2:0.03811 +100:gen_thread:1:2:0.039096 +100:gen_thread:1:2:0.037598 +100:gen_thread:1:2:0.037482 +100:gen_thread:1:2:0.037511 +100:gen_thread:1:2:0.037197 +100:gen_thread:1:2:0.038262 +100:gen_thread:1:2:0.037706 +100:gen_thread:1:2:0.037447 +100:gen_thread:1:2:0.037271 +100:gen_thread:1:2:0.037729 +100:gen_thread:1:2:0.037514 +100:gen_thread:1:2:0.037588 +100:gen_thread:1:2:0.037843 +100:gen_thread:1:2:0.037125 +100:gen_thread:1:2:0.037942 +1000:gen_thread:1:2:0.048777 +1000:gen_thread:1:2:0.047191 +1000:gen_thread:1:2:0.047185 +1000:gen_thread:1:2:0.047495 +1000:gen_thread:1:2:0.04759 +1000:gen_thread:1:2:0.047365 +1000:gen_thread:1:2:0.047472 +1000:gen_thread:1:2:0.04793 +1000:gen_thread:1:2:0.047688 +1000:gen_thread:1:2:0.047779 +1000:gen_thread:1:2:0.047597 +1000:gen_thread:1:2:0.047623 +1000:gen_thread:1:2:0.047455 +1000:gen_thread:1:2:0.046633 +1000:gen_thread:1:2:0.047692 +1000:gen_thread:1:2:0.047886 +1000:gen_thread:1:2:0.047235 +1000:gen_thread:1:2:0.047726 +1000:gen_thread:1:2:0.04737 +1000:gen_thread:1:2:0.047529 +10000:gen_thread:1:2:0.084456 +10000:gen_thread:1:2:0.086555 +10000:gen_thread:1:2:0.083551 +10000:gen_thread:1:2:0.08434 +10000:gen_thread:1:2:0.083747 +10000:gen_thread:1:2:0.084739 +10000:gen_thread:1:2:0.0847 +10000:gen_thread:1:2:0.084515 +10000:gen_thread:1:2:0.084117 +10000:gen_thread:1:2:0.083638 +10000:gen_thread:1:2:0.084238 +10000:gen_thread:1:2:0.084247 +10000:gen_thread:1:2:0.084626 +10000:gen_thread:1:2:0.084727 +10000:gen_thread:1:2:0.083969 +10000:gen_thread:1:2:0.083425 +10000:gen_thread:1:2:0.086749 +10000:gen_thread:1:2:0.084205 +10000:gen_thread:1:2:0.084862 +10000:gen_thread:1:2:0.084379 +100000:gen_thread:1:2:0.643129 +100000:gen_thread:1:2:0.64416 +100000:gen_thread:1:2:0.664169 +100000:gen_thread:1:2:0.64299 +100000:gen_thread:1:2:0.676296 +100000:gen_thread:1:2:0.644504 +100000:gen_thread:1:2:0.643309 +100000:gen_thread:1:2:0.646974 +100000:gen_thread:1:2:0.64421 +100000:gen_thread:1:2:0.643596 +100000:gen_thread:1:2:0.658619 +100000:gen_thread:1:2:0.643144 +100000:gen_thread:1:2:0.642244 +100000:gen_thread:1:2:0.645733 +100000:gen_thread:1:2:0.642106 +100000:gen_thread:1:2:0.646983 +100000:gen_thread:1:2:0.644769 +100000:gen_thread:1:2:0.709358 +100000:gen_thread:1:2:0.642487 +100000:gen_thread:1:2:0.643115 +1000000:gen_thread:1:2:6.06577 +1000000:gen_thread:1:2:6.03703 +1000000:gen_thread:1:2:6.07467 +1000000:gen_thread:1:2:6.07766 +1000000:gen_thread:1:2:6.08601 +1000000:gen_thread:1:2:6.09666 +1000000:gen_thread:1:2:6.035 +1000000:gen_thread:1:2:6.03317 +1000000:gen_thread:1:2:6.0767 +1000000:gen_thread:1:2:6.05541 +1000000:gen_thread:1:2:6.04815 +1000000:gen_thread:1:2:6.06811 +1000000:gen_thread:1:2:6.06384 +1000000:gen_thread:1:2:6.1534 +1000000:gen_thread:1:2:6.07441 +1000000:gen_thread:1:2:6.09596 +1000000:gen_thread:1:2:6.08524 +1000000:gen_thread:1:2:6.10091 +1000000:gen_thread:1:2:6.09087 +1000000:gen_thread:1:2:6.07658 +10000000:gen_thread:1:2:70.7172 +10000000:gen_thread:1:2:70.3879 +10000000:gen_thread:1:2:71.2249 +10000000:gen_thread:1:2:70.0712 +10000000:gen_thread:1:2:70.337 +10000000:gen_thread:1:2:70.3227 +10000000:gen_thread:1:2:70.4232 +10000000:gen_thread:1:2:70.4569 +10000000:gen_thread:1:2:70.5256 +10000000:gen_thread:1:2:70.6402 +10000000:gen_thread:1:2:70.0962 +10000000:gen_thread:1:2:70.2613 +10000000:gen_thread:1:2:70.4054 +10000000:gen_thread:1:2:70.6433 +10000000:gen_thread:1:2:70.4634 +10000000:gen_thread:1:2:70.3107 +10000000:gen_thread:1:2:70.7925 +10000000:gen_thread:1:2:70.3368 +10000000:gen_thread:1:2:70.4898 +10000000:gen_thread:1:2:70.1771 diff --git a/results/rt/data_basic/rt_size_2_omp b/results/rt/data_basic/rt_size_2_omp new file mode 100644 index 0000000..6bffe8b --- /dev/null +++ b/results/rt/data_basic/rt_size_2_omp @@ -0,0 +1,120 @@ +100:omp:1:2:0.013395 +100:omp:1:2:0.012471 +100:omp:1:2:0.01167 +100:omp:1:2:0.014533 +100:omp:1:2:0.013684 +100:omp:1:2:0.012734 +100:omp:1:2:0.014292 +100:omp:1:2:0.012519 +100:omp:1:2:0.012242 +100:omp:1:2:0.013028 +100:omp:1:2:0.012622 +100:omp:1:2:0.01203 +100:omp:1:2:0.011716 +100:omp:1:2:0.012211 +100:omp:1:2:0.012792 +100:omp:1:2:0.011495 +100:omp:1:2:0.011468 +100:omp:1:2:0.011522 +100:omp:1:2:0.015875 +100:omp:1:2:0.012932 +1000:omp:1:2:0.015355 +1000:omp:1:2:0.013049 +1000:omp:1:2:0.013153 +1000:omp:1:2:0.01515 +1000:omp:1:2:0.013644 +1000:omp:1:2:0.01577 +1000:omp:1:2:0.013414 +1000:omp:1:2:0.013911 +1000:omp:1:2:0.013404 +1000:omp:1:2:0.01338 +1000:omp:1:2:0.013325 +1000:omp:1:2:0.013395 +1000:omp:1:2:0.013868 +1000:omp:1:2:0.013113 +1000:omp:1:2:0.012889 +1000:omp:1:2:0.013254 +1000:omp:1:2:0.013872 +1000:omp:1:2:0.01286 +1000:omp:1:2:0.012502 +1000:omp:1:2:0.012877 +10000:omp:1:2:0.046139 +10000:omp:1:2:0.042587 +10000:omp:1:2:0.038511 +10000:omp:1:2:0.034666 +10000:omp:1:2:0.036471 +10000:omp:1:2:0.035838 +10000:omp:1:2:0.037033 +10000:omp:1:2:0.03613 +10000:omp:1:2:0.039019 +10000:omp:1:2:0.035333 +10000:omp:1:2:0.036977 +10000:omp:1:2:0.035444 +10000:omp:1:2:0.039035 +10000:omp:1:2:0.037177 +10000:omp:1:2:0.074902 +10000:omp:1:2:0.054473 +10000:omp:1:2:0.055577 +10000:omp:1:2:0.047426 +10000:omp:1:2:0.046874 +10000:omp:1:2:0.043375 +100000:omp:1:2:0.615342 +100000:omp:1:2:0.548964 +100000:omp:1:2:0.560816 +100000:omp:1:2:0.55036 +100000:omp:1:2:0.555486 +100000:omp:1:2:0.549549 +100000:omp:1:2:0.546042 +100000:omp:1:2:0.54803 +100000:omp:1:2:0.548292 +100000:omp:1:2:0.547225 +100000:omp:1:2:0.559832 +100000:omp:1:2:0.547164 +100000:omp:1:2:0.554127 +100000:omp:1:2:0.557318 +100000:omp:1:2:0.539766 +100000:omp:1:2:0.551122 +100000:omp:1:2:0.543332 +100000:omp:1:2:0.536293 +100000:omp:1:2:0.543234 +100000:omp:1:2:0.547369 +1000000:omp:1:2:5.47603 +1000000:omp:1:2:5.5047 +1000000:omp:1:2:5.46448 +1000000:omp:1:2:5.43405 +1000000:omp:1:2:5.44043 +1000000:omp:1:2:5.41084 +1000000:omp:1:2:5.41422 +1000000:omp:1:2:5.43695 +1000000:omp:1:2:5.43224 +1000000:omp:1:2:5.42837 +1000000:omp:1:2:5.4484 +1000000:omp:1:2:5.47451 +1000000:omp:1:2:5.57224 +1000000:omp:1:2:5.51349 +1000000:omp:1:2:5.41616 +1000000:omp:1:2:5.45003 +1000000:omp:1:2:5.40642 +1000000:omp:1:2:5.40609 +1000000:omp:1:2:5.39714 +1000000:omp:1:2:5.43052 +10000000:omp:1:2:61.6663 +10000000:omp:1:2:61.56 +10000000:omp:1:2:61.7878 +10000000:omp:1:2:61.573 +10000000:omp:1:2:61.6388 +10000000:omp:1:2:61.6154 +10000000:omp:1:2:61.7131 +10000000:omp:1:2:61.6227 +10000000:omp:1:2:61.7379 +10000000:omp:1:2:61.6059 +10000000:omp:1:2:61.9037 +10000000:omp:1:2:61.7024 +10000000:omp:1:2:61.6347 +10000000:omp:1:2:61.6055 +10000000:omp:1:2:61.503 +10000000:omp:1:2:61.7634 +10000000:omp:1:2:61.6416 +10000000:omp:1:2:61.7437 +10000000:omp:1:2:61.7245 +10000000:omp:1:2:61.6891 diff --git a/results/rt/data_basic/rt_size_2_seq b/results/rt/data_basic/rt_size_2_seq new file mode 100644 index 0000000..1061232 --- /dev/null +++ b/results/rt/data_basic/rt_size_2_seq @@ -0,0 +1,120 @@ +100:seq:1:2:0.000449 +100:seq:1:2:0.000417 +100:seq:1:2:0.00044 +100:seq:1:2:0.00044 +100:seq:1:2:0.000447 +100:seq:1:2:0.000422 +100:seq:1:2:0.000469 +100:seq:1:2:0.000464 +100:seq:1:2:0.000446 +100:seq:1:2:0.00047 +100:seq:1:2:0.000472 +100:seq:1:2:0.000447 +100:seq:1:2:0.00044 +100:seq:1:2:0.00044 +100:seq:1:2:0.00047 +100:seq:1:2:0.000461 +100:seq:1:2:0.000463 +100:seq:1:2:0.000513 +100:seq:1:2:0.000502 +100:seq:1:2:0.0005 +1000:seq:1:2:0.004844 +1000:seq:1:2:0.004837 +1000:seq:1:2:0.004574 +1000:seq:1:2:0.004565 +1000:seq:1:2:0.004563 +1000:seq:1:2:0.004571 +1000:seq:1:2:0.004329 +1000:seq:1:2:0.004322 +1000:seq:1:2:0.004321 +1000:seq:1:2:0.004327 +1000:seq:1:2:0.004328 +1000:seq:1:2:0.004329 +1000:seq:1:2:0.004117 +1000:seq:1:2:0.004105 +1000:seq:1:2:0.00411 +1000:seq:1:2:0.004105 +1000:seq:1:2:0.003914 +1000:seq:1:2:0.003913 +1000:seq:1:2:0.003908 +1000:seq:1:2:0.003906 +10000:seq:1:2:0.037203 +10000:seq:1:2:0.028739 +10000:seq:1:2:0.025477 +10000:seq:1:2:0.025415 +10000:seq:1:2:0.025451 +10000:seq:1:2:0.025456 +10000:seq:1:2:0.025442 +10000:seq:1:2:0.025362 +10000:seq:1:2:0.025428 +10000:seq:1:2:0.025312 +10000:seq:1:2:0.025364 +10000:seq:1:2:0.025417 +10000:seq:1:2:0.025326 +10000:seq:1:2:0.053948 +10000:seq:1:2:0.046193 +10000:seq:1:2:0.039237 +10000:seq:1:2:0.035298 +10000:seq:1:2:0.029865 +10000:seq:1:2:0.025394 +10000:seq:1:2:0.02559 +100000:seq:1:2:0.53889 +100000:seq:1:2:0.530581 +100000:seq:1:2:0.532683 +100000:seq:1:2:0.527479 +100000:seq:1:2:0.531305 +100000:seq:1:2:0.536995 +100000:seq:1:2:0.54141 +100000:seq:1:2:0.533448 +100000:seq:1:2:0.531741 +100000:seq:1:2:0.535926 +100000:seq:1:2:0.533264 +100000:seq:1:2:0.529921 +100000:seq:1:2:0.536711 +100000:seq:1:2:0.532327 +100000:seq:1:2:0.537686 +100000:seq:1:2:0.531817 +100000:seq:1:2:0.541854 +100000:seq:1:2:0.535483 +100000:seq:1:2:0.552265 +100000:seq:1:2:0.539049 +1000000:seq:1:2:5.3945 +1000000:seq:1:2:5.41263 +1000000:seq:1:2:5.39932 +1000000:seq:1:2:5.37993 +1000000:seq:1:2:5.39509 +1000000:seq:1:2:5.40296 +1000000:seq:1:2:5.40632 +1000000:seq:1:2:5.38614 +1000000:seq:1:2:5.43084 +1000000:seq:1:2:5.39025 +1000000:seq:1:2:5.40204 +1000000:seq:1:2:5.36538 +1000000:seq:1:2:5.40798 +1000000:seq:1:2:5.43489 +1000000:seq:1:2:5.3735 +1000000:seq:1:2:5.35997 +1000000:seq:1:2:5.40214 +1000000:seq:1:2:5.35416 +1000000:seq:1:2:5.40426 +1000000:seq:1:2:5.40756 +10000000:seq:1:2:61.2186 +10000000:seq:1:2:61.363 +10000000:seq:1:2:61.224 +10000000:seq:1:2:61.1909 +10000000:seq:1:2:61.1335 +10000000:seq:1:2:61.2064 +10000000:seq:1:2:61.231 +10000000:seq:1:2:61.4416 +10000000:seq:1:2:61.2481 +10000000:seq:1:2:61.356 +10000000:seq:1:2:61.1577 +10000000:seq:1:2:61.2135 +10000000:seq:1:2:61.3013 +10000000:seq:1:2:61.2147 +10000000:seq:1:2:61.297 +10000000:seq:1:2:61.3479 +10000000:seq:1:2:61.2662 +10000000:seq:1:2:61.2801 +10000000:seq:1:2:61.1721 +10000000:seq:1:2:61.3519 diff --git a/results/rt/data_basic/rt_size_4_gen_omp b/results/rt/data_basic/rt_size_4_gen_omp new file mode 100644 index 0000000..99838a2 --- /dev/null +++ b/results/rt/data_basic/rt_size_4_gen_omp @@ -0,0 +1,120 @@ +100:gen_omp:1:4:0.09002 +100:gen_omp:1:4:0.079483 +100:gen_omp:1:4:0.069966 +100:gen_omp:1:4:0.075371 +100:gen_omp:1:4:0.087289 +100:gen_omp:1:4:0.078637 +100:gen_omp:1:4:0.091212 +100:gen_omp:1:4:0.083366 +100:gen_omp:1:4:0.075463 +100:gen_omp:1:4:0.072961 +100:gen_omp:1:4:0.079799 +100:gen_omp:1:4:0.081233 +100:gen_omp:1:4:0.074598 +100:gen_omp:1:4:0.076388 +100:gen_omp:1:4:0.072952 +100:gen_omp:1:4:0.072088 +100:gen_omp:1:4:0.086407 +100:gen_omp:1:4:0.070711 +100:gen_omp:1:4:0.076997 +100:gen_omp:1:4:0.066255 +1000:gen_omp:1:4:0.045319 +1000:gen_omp:1:4:0.0448 +1000:gen_omp:1:4:0.044965 +1000:gen_omp:1:4:0.042868 +1000:gen_omp:1:4:0.046053 +1000:gen_omp:1:4:0.044942 +1000:gen_omp:1:4:0.045854 +1000:gen_omp:1:4:0.047206 +1000:gen_omp:1:4:0.042545 +1000:gen_omp:1:4:0.045736 +1000:gen_omp:1:4:0.046053 +1000:gen_omp:1:4:0.046455 +1000:gen_omp:1:4:0.046913 +1000:gen_omp:1:4:0.046044 +1000:gen_omp:1:4:0.048725 +1000:gen_omp:1:4:0.048664 +1000:gen_omp:1:4:0.048385 +1000:gen_omp:1:4:0.04911 +1000:gen_omp:1:4:0.04383 +1000:gen_omp:1:4:0.043196 +10000:gen_omp:1:4:0.096788 +10000:gen_omp:1:4:0.087854 +10000:gen_omp:1:4:0.083051 +10000:gen_omp:1:4:0.079063 +10000:gen_omp:1:4:0.650995 +10000:gen_omp:1:4:0.096747 +10000:gen_omp:1:4:0.088579 +10000:gen_omp:1:4:0.083359 +10000:gen_omp:1:4:0.080991 +10000:gen_omp:1:4:0.071159 +10000:gen_omp:1:4:0.07639 +10000:gen_omp:1:4:0.075435 +10000:gen_omp:1:4:0.07063 +10000:gen_omp:1:4:0.062895 +10000:gen_omp:1:4:0.062546 +10000:gen_omp:1:4:0.064346 +10000:gen_omp:1:4:0.062649 +10000:gen_omp:1:4:0.06449 +10000:gen_omp:1:4:0.062688 +10000:gen_omp:1:4:0.061897 +100000:gen_omp:1:4:0.676734 +100000:gen_omp:1:4:0.659196 +100000:gen_omp:1:4:0.677275 +100000:gen_omp:1:4:0.666677 +100000:gen_omp:1:4:0.646243 +100000:gen_omp:1:4:0.662716 +100000:gen_omp:1:4:1.46699 +100000:gen_omp:1:4:0.806465 +100000:gen_omp:1:4:0.663557 +100000:gen_omp:1:4:0.652103 +100000:gen_omp:1:4:0.65887 +100000:gen_omp:1:4:0.657053 +100000:gen_omp:1:4:0.689891 +100000:gen_omp:1:4:0.657834 +100000:gen_omp:1:4:0.691385 +100000:gen_omp:1:4:0.668124 +100000:gen_omp:1:4:0.694781 +100000:gen_omp:1:4:0.655963 +100000:gen_omp:1:4:0.685771 +100000:gen_omp:1:4:0.676083 +1000000:gen_omp:1:4:6.35046 +1000000:gen_omp:1:4:6.37121 +1000000:gen_omp:1:4:6.38312 +1000000:gen_omp:1:4:6.29115 +1000000:gen_omp:1:4:6.34516 +1000000:gen_omp:1:4:6.83924 +1000000:gen_omp:1:4:6.48741 +1000000:gen_omp:1:4:6.32551 +1000000:gen_omp:1:4:6.22862 +1000000:gen_omp:1:4:6.2678 +1000000:gen_omp:1:4:6.29871 +1000000:gen_omp:1:4:6.32385 +1000000:gen_omp:1:4:6.31226 +1000000:gen_omp:1:4:6.3422 +1000000:gen_omp:1:4:6.33611 +1000000:gen_omp:1:4:6.32019 +1000000:gen_omp:1:4:6.3721 +1000000:gen_omp:1:4:6.33223 +1000000:gen_omp:1:4:6.32945 +1000000:gen_omp:1:4:6.31541 +10000000:gen_omp:1:4:67.696 +10000000:gen_omp:1:4:67.9758 +10000000:gen_omp:1:4:68.0001 +10000000:gen_omp:1:4:68.0607 +10000000:gen_omp:1:4:68.3308 +10000000:gen_omp:1:4:67.5805 +10000000:gen_omp:1:4:67.6241 +10000000:gen_omp:1:4:67.8284 +10000000:gen_omp:1:4:67.6987 +10000000:gen_omp:1:4:67.6202 +10000000:gen_omp:1:4:67.666 +10000000:gen_omp:1:4:67.5967 +10000000:gen_omp:1:4:67.638 +10000000:gen_omp:1:4:67.5679 +10000000:gen_omp:1:4:67.5555 +10000000:gen_omp:1:4:67.8154 +10000000:gen_omp:1:4:67.9595 +10000000:gen_omp:1:4:67.9674 +10000000:gen_omp:1:4:68.1275 +10000000:gen_omp:1:4:68.1124 diff --git a/results/rt/data_basic/rt_size_4_gen_thread b/results/rt/data_basic/rt_size_4_gen_thread new file mode 100644 index 0000000..f38f9f9 --- /dev/null +++ b/results/rt/data_basic/rt_size_4_gen_thread @@ -0,0 +1,120 @@ +100:gen_thread:1:4:0.125348 +100:gen_thread:1:4:0.125902 +100:gen_thread:1:4:0.117258 +100:gen_thread:1:4:0.128061 +100:gen_thread:1:4:0.130242 +100:gen_thread:1:4:0.126233 +100:gen_thread:1:4:0.134462 +100:gen_thread:1:4:0.12715 +100:gen_thread:1:4:0.137542 +100:gen_thread:1:4:0.116115 +100:gen_thread:1:4:0.109579 +100:gen_thread:1:4:0.11054 +100:gen_thread:1:4:0.132198 +100:gen_thread:1:4:0.121541 +100:gen_thread:1:4:0.109221 +100:gen_thread:1:4:0.11395 +100:gen_thread:1:4:0.110972 +100:gen_thread:1:4:0.107542 +100:gen_thread:1:4:0.107349 +100:gen_thread:1:4:0.108249 +1000:gen_thread:1:4:0.148273 +1000:gen_thread:1:4:0.167334 +1000:gen_thread:1:4:0.158441 +1000:gen_thread:1:4:0.150526 +1000:gen_thread:1:4:0.147905 +1000:gen_thread:1:4:0.160106 +1000:gen_thread:1:4:0.165529 +1000:gen_thread:1:4:0.153112 +1000:gen_thread:1:4:0.152841 +1000:gen_thread:1:4:0.155534 +1000:gen_thread:1:4:0.154441 +1000:gen_thread:1:4:0.165711 +1000:gen_thread:1:4:0.162058 +1000:gen_thread:1:4:0.174273 +1000:gen_thread:1:4:0.158491 +1000:gen_thread:1:4:0.168426 +1000:gen_thread:1:4:0.170366 +1000:gen_thread:1:4:0.17283 +1000:gen_thread:1:4:0.166511 +1000:gen_thread:1:4:0.16225 +10000:gen_thread:1:4:0.237886 +10000:gen_thread:1:4:0.24282 +10000:gen_thread:1:4:0.233893 +10000:gen_thread:1:4:0.211995 +10000:gen_thread:1:4:0.200139 +10000:gen_thread:1:4:0.195825 +10000:gen_thread:1:4:0.185664 +10000:gen_thread:1:4:0.188091 +10000:gen_thread:1:4:0.219095 +10000:gen_thread:1:4:0.236282 +10000:gen_thread:1:4:0.223444 +10000:gen_thread:1:4:0.210029 +10000:gen_thread:1:4:0.22116 +10000:gen_thread:1:4:0.196133 +10000:gen_thread:1:4:0.192063 +10000:gen_thread:1:4:0.217682 +10000:gen_thread:1:4:0.218579 +10000:gen_thread:1:4:0.195782 +10000:gen_thread:1:4:0.197348 +10000:gen_thread:1:4:0.186426 +100000:gen_thread:1:4:1.04311 +100000:gen_thread:1:4:0.885441 +100000:gen_thread:1:4:0.996433 +100000:gen_thread:1:4:0.970238 +100000:gen_thread:1:4:0.753244 +100000:gen_thread:1:4:0.776447 +100000:gen_thread:1:4:0.758305 +100000:gen_thread:1:4:0.754638 +100000:gen_thread:1:4:0.745248 +100000:gen_thread:1:4:1.07648 +100000:gen_thread:1:4:1.00097 +100000:gen_thread:1:4:0.770581 +100000:gen_thread:1:4:0.861306 +100000:gen_thread:1:4:1.07146 +100000:gen_thread:1:4:0.961153 +100000:gen_thread:1:4:0.966817 +100000:gen_thread:1:4:0.780133 +100000:gen_thread:1:4:0.745724 +100000:gen_thread:1:4:0.751934 +100000:gen_thread:1:4:0.767928 +1000000:gen_thread:1:4:6.34155 +1000000:gen_thread:1:4:6.31426 +1000000:gen_thread:1:4:6.1824 +1000000:gen_thread:1:4:6.33992 +1000000:gen_thread:1:4:6.31163 +1000000:gen_thread:1:4:6.17618 +1000000:gen_thread:1:4:6.37973 +1000000:gen_thread:1:4:6.43594 +1000000:gen_thread:1:4:6.38971 +1000000:gen_thread:1:4:6.19309 +1000000:gen_thread:1:4:6.23812 +1000000:gen_thread:1:4:6.40834 +1000000:gen_thread:1:4:6.33319 +1000000:gen_thread:1:4:6.16702 +1000000:gen_thread:1:4:6.3298 +1000000:gen_thread:1:4:6.39489 +1000000:gen_thread:1:4:6.40665 +1000000:gen_thread:1:4:6.3615 +1000000:gen_thread:1:4:6.2747 +1000000:gen_thread:1:4:6.48043 +10000000:gen_thread:1:4:73.451 +10000000:gen_thread:1:4:72.7672 +10000000:gen_thread:1:4:72.9177 +10000000:gen_thread:1:4:72.6552 +10000000:gen_thread:1:4:72.7033 +10000000:gen_thread:1:4:72.9555 +10000000:gen_thread:1:4:72.8948 +10000000:gen_thread:1:4:72.6995 +10000000:gen_thread:1:4:73.0351 +10000000:gen_thread:1:4:73.3785 +10000000:gen_thread:1:4:72.8765 +10000000:gen_thread:1:4:72.6707 +10000000:gen_thread:1:4:72.7158 +10000000:gen_thread:1:4:72.749 +10000000:gen_thread:1:4:73.2773 +10000000:gen_thread:1:4:72.7076 +10000000:gen_thread:1:4:73.0119 +10000000:gen_thread:1:4:73.0811 +10000000:gen_thread:1:4:72.8952 +10000000:gen_thread:1:4:73.2266 diff --git a/results/rt/data_basic/rt_size_4_omp b/results/rt/data_basic/rt_size_4_omp new file mode 100644 index 0000000..27a02a4 --- /dev/null +++ b/results/rt/data_basic/rt_size_4_omp @@ -0,0 +1,120 @@ +100:omp:1:4:0.071996 +100:omp:1:4:0.08926 +100:omp:1:4:0.078705 +100:omp:1:4:0.068548 +100:omp:1:4:0.076447 +100:omp:1:4:0.078912 +100:omp:1:4:0.062029 +100:omp:1:4:0.082828 +100:omp:1:4:0.077958 +100:omp:1:4:0.06367 +100:omp:1:4:0.065379 +100:omp:1:4:0.068666 +100:omp:1:4:0.067526 +100:omp:1:4:0.071073 +100:omp:1:4:0.064258 +100:omp:1:4:0.069991 +100:omp:1:4:0.073387 +100:omp:1:4:0.064259 +100:omp:1:4:0.07342 +100:omp:1:4:0.077467 +1000:omp:1:4:0.040275 +1000:omp:1:4:0.041161 +1000:omp:1:4:0.041614 +1000:omp:1:4:0.040612 +1000:omp:1:4:0.042388 +1000:omp:1:4:0.04226 +1000:omp:1:4:0.041953 +1000:omp:1:4:0.041798 +1000:omp:1:4:0.042002 +1000:omp:1:4:0.042831 +1000:omp:1:4:0.042084 +1000:omp:1:4:0.043313 +1000:omp:1:4:0.043312 +1000:omp:1:4:0.042446 +1000:omp:1:4:0.041849 +1000:omp:1:4:0.043067 +1000:omp:1:4:0.044 +1000:omp:1:4:0.043509 +1000:omp:1:4:0.042942 +1000:omp:1:4:0.044362 +10000:omp:1:4:0.082898 +10000:omp:1:4:0.07773 +10000:omp:1:4:0.07523 +10000:omp:1:4:0.070774 +10000:omp:1:4:0.071422 +10000:omp:1:4:0.067534 +10000:omp:1:4:0.06534 +10000:omp:1:4:0.063645 +10000:omp:1:4:0.061465 +10000:omp:1:4:0.060589 +10000:omp:1:4:0.059092 +10000:omp:1:4:0.056946 +10000:omp:1:4:0.055485 +10000:omp:1:4:0.054203 +10000:omp:1:4:0.052041 +10000:omp:1:4:0.053101 +10000:omp:1:4:0.051001 +10000:omp:1:4:0.051323 +10000:omp:1:4:0.051902 +10000:omp:1:4:0.051324 +100000:omp:1:4:0.564698 +100000:omp:1:4:0.568473 +100000:omp:1:4:0.556976 +100000:omp:1:4:0.564384 +100000:omp:1:4:0.586273 +100000:omp:1:4:0.569299 +100000:omp:1:4:0.583644 +100000:omp:1:4:0.559 +100000:omp:1:4:0.567252 +100000:omp:1:4:0.564222 +100000:omp:1:4:0.569613 +100000:omp:1:4:0.563344 +100000:omp:1:4:0.562515 +100000:omp:1:4:0.570861 +100000:omp:1:4:0.55835 +100000:omp:1:4:0.565285 +100000:omp:1:4:0.602316 +100000:omp:1:4:0.557754 +100000:omp:1:4:0.595165 +100000:omp:1:4:1.18653 +1000000:omp:1:4:5.67962 +1000000:omp:1:4:5.58816 +1000000:omp:1:4:5.57707 +1000000:omp:1:4:5.64112 +1000000:omp:1:4:5.63405 +1000000:omp:1:4:5.60289 +1000000:omp:1:4:5.5645 +1000000:omp:1:4:5.64851 +1000000:omp:1:4:5.61552 +1000000:omp:1:4:5.58098 +1000000:omp:1:4:5.58661 +1000000:omp:1:4:5.60144 +1000000:omp:1:4:5.57184 +1000000:omp:1:4:5.59656 +1000000:omp:1:4:5.60054 +1000000:omp:1:4:5.63172 +1000000:omp:1:4:5.9762 +1000000:omp:1:4:5.63262 +1000000:omp:1:4:5.61453 +1000000:omp:1:4:5.60484 +10000000:omp:1:4:62.6349 +10000000:omp:1:4:63.2779 +10000000:omp:1:4:63.0591 +10000000:omp:1:4:62.5644 +10000000:omp:1:4:63.0543 +10000000:omp:1:4:63.0058 +10000000:omp:1:4:63.0739 +10000000:omp:1:4:62.7382 +10000000:omp:1:4:63.2905 +10000000:omp:1:4:62.7899 +10000000:omp:1:4:62.8154 +10000000:omp:1:4:62.6783 +10000000:omp:1:4:62.5034 +10000000:omp:1:4:62.466 +10000000:omp:1:4:63.3671 +10000000:omp:1:4:63.3138 +10000000:omp:1:4:62.6614 +10000000:omp:1:4:62.9909 +10000000:omp:1:4:62.8471 +10000000:omp:1:4:62.4367 diff --git a/results/rt/data_basic/rt_size_4_seq b/results/rt/data_basic/rt_size_4_seq new file mode 100644 index 0000000..0049d76 --- /dev/null +++ b/results/rt/data_basic/rt_size_4_seq @@ -0,0 +1,120 @@ +100:seq:1:4:0.000253 +100:seq:1:4:0.000274 +100:seq:1:4:0.000262 +100:seq:1:4:0.000255 +100:seq:1:4:0.000252 +100:seq:1:4:0.000253 +100:seq:1:4:0.000252 +100:seq:1:4:0.000252 +100:seq:1:4:0.000252 +100:seq:1:4:0.000275 +100:seq:1:4:0.000252 +100:seq:1:4:0.000253 +100:seq:1:4:0.000253 +100:seq:1:4:0.000253 +100:seq:1:4:0.000254 +100:seq:1:4:0.00026 +100:seq:1:4:0.000254 +100:seq:1:4:0.000252 +100:seq:1:4:0.000253 +100:seq:1:4:0.000288 +1000:seq:1:4:0.002496 +1000:seq:1:4:0.002497 +1000:seq:1:4:0.002489 +1000:seq:1:4:0.002479 +1000:seq:1:4:0.00248 +1000:seq:1:4:0.002535 +1000:seq:1:4:0.002534 +1000:seq:1:4:0.002534 +1000:seq:1:4:0.002555 +1000:seq:1:4:0.002519 +1000:seq:1:4:0.002481 +1000:seq:1:4:0.002484 +1000:seq:1:4:0.002491 +1000:seq:1:4:0.002552 +1000:seq:1:4:0.002495 +1000:seq:1:4:0.002497 +1000:seq:1:4:0.002545 +1000:seq:1:4:0.002488 +1000:seq:1:4:0.002489 +1000:seq:1:4:0.002497 +10000:seq:1:4:0.025644 +10000:seq:1:4:0.025433 +10000:seq:1:4:0.025441 +10000:seq:1:4:0.025534 +10000:seq:1:4:0.025527 +10000:seq:1:4:0.025387 +10000:seq:1:4:0.02543 +10000:seq:1:4:0.025434 +10000:seq:1:4:0.025667 +10000:seq:1:4:0.025494 +10000:seq:1:4:0.025405 +10000:seq:1:4:0.025628 +10000:seq:1:4:0.025417 +10000:seq:1:4:0.025451 +10000:seq:1:4:0.025437 +10000:seq:1:4:0.025446 +10000:seq:1:4:0.025374 +10000:seq:1:4:0.025345 +10000:seq:1:4:0.025584 +10000:seq:1:4:0.025427 +100000:seq:1:4:0.534952 +100000:seq:1:4:0.53719 +100000:seq:1:4:0.5309 +100000:seq:1:4:0.539343 +100000:seq:1:4:0.532971 +100000:seq:1:4:0.532034 +100000:seq:1:4:0.537069 +100000:seq:1:4:0.53949 +100000:seq:1:4:0.533811 +100000:seq:1:4:0.537677 +100000:seq:1:4:0.537396 +100000:seq:1:4:0.535862 +100000:seq:1:4:0.543119 +100000:seq:1:4:0.538745 +100000:seq:1:4:0.539738 +100000:seq:1:4:0.53306 +100000:seq:1:4:0.533759 +100000:seq:1:4:0.539996 +100000:seq:1:4:0.537008 +100000:seq:1:4:0.548399 +1000000:seq:1:4:5.40211 +1000000:seq:1:4:5.40247 +1000000:seq:1:4:5.3663 +1000000:seq:1:4:5.39675 +1000000:seq:1:4:5.40011 +1000000:seq:1:4:5.3855 +1000000:seq:1:4:5.42673 +1000000:seq:1:4:5.39636 +1000000:seq:1:4:5.40687 +1000000:seq:1:4:5.36691 +1000000:seq:1:4:5.39953 +1000000:seq:1:4:5.38254 +1000000:seq:1:4:5.41757 +1000000:seq:1:4:5.36987 +1000000:seq:1:4:5.36659 +1000000:seq:1:4:5.39513 +1000000:seq:1:4:5.40783 +1000000:seq:1:4:5.3503 +1000000:seq:1:4:5.38501 +1000000:seq:1:4:5.36401 +10000000:seq:1:4:61.3558 +10000000:seq:1:4:61.2454 +10000000:seq:1:4:61.1594 +10000000:seq:1:4:61.0866 +10000000:seq:1:4:61.1897 +10000000:seq:1:4:61.1688 +10000000:seq:1:4:61.3311 +10000000:seq:1:4:61.2003 +10000000:seq:1:4:61.3084 +10000000:seq:1:4:61.1808 +10000000:seq:1:4:61.3226 +10000000:seq:1:4:61.259 +10000000:seq:1:4:61.3688 +10000000:seq:1:4:61.2104 +10000000:seq:1:4:60.6923 +10000000:seq:1:4:61.2895 +10000000:seq:1:4:61.2155 +10000000:seq:1:4:61.3847 +10000000:seq:1:4:61.2617 +10000000:seq:1:4:61.3472 diff --git a/results/rt/data_basic/rt_size_6_gen_omp b/results/rt/data_basic/rt_size_6_gen_omp new file mode 100644 index 0000000..6baeedd --- /dev/null +++ b/results/rt/data_basic/rt_size_6_gen_omp @@ -0,0 +1,120 @@ +100:gen_omp:1:6:0.086406 +100:gen_omp:1:6:0.077052 +100:gen_omp:1:6:0.067029 +100:gen_omp:1:6:0.100558 +100:gen_omp:1:6:0.093721 +100:gen_omp:1:6:0.087943 +100:gen_omp:1:6:0.062381 +100:gen_omp:1:6:0.095741 +100:gen_omp:1:6:0.095075 +100:gen_omp:1:6:0.091973 +100:gen_omp:1:6:0.045635 +100:gen_omp:1:6:0.088715 +100:gen_omp:1:6:0.073478 +100:gen_omp:1:6:0.097792 +100:gen_omp:1:6:0.090863 +100:gen_omp:1:6:0.089194 +100:gen_omp:1:6:0.083434 +100:gen_omp:1:6:0.087038 +100:gen_omp:1:6:0.086448 +100:gen_omp:1:6:0.085036 +1000:gen_omp:1:6:0.100085 +1000:gen_omp:1:6:0.069946 +1000:gen_omp:1:6:0.108796 +1000:gen_omp:1:6:0.071655 +1000:gen_omp:1:6:0.11687 +1000:gen_omp:1:6:0.068686 +1000:gen_omp:1:6:0.11912 +1000:gen_omp:1:6:0.090969 +1000:gen_omp:1:6:0.110951 +1000:gen_omp:1:6:0.096502 +1000:gen_omp:1:6:0.094783 +1000:gen_omp:1:6:0.069556 +1000:gen_omp:1:6:0.115636 +1000:gen_omp:1:6:0.108561 +1000:gen_omp:1:6:0.104227 +1000:gen_omp:1:6:0.099113 +1000:gen_omp:1:6:0.067226 +1000:gen_omp:1:6:0.111868 +1000:gen_omp:1:6:0.085766 +1000:gen_omp:1:6:0.106897 +10000:gen_omp:1:6:0.148836 +10000:gen_omp:1:6:0.117273 +10000:gen_omp:1:6:0.146445 +10000:gen_omp:1:6:0.108907 +10000:gen_omp:1:6:0.131556 +10000:gen_omp:1:6:0.166566 +10000:gen_omp:1:6:0.147842 +10000:gen_omp:1:6:0.136342 +10000:gen_omp:1:6:0.135272 +10000:gen_omp:1:6:0.124131 +10000:gen_omp:1:6:0.123419 +10000:gen_omp:1:6:0.153924 +10000:gen_omp:1:6:0.113484 +10000:gen_omp:1:6:0.159719 +10000:gen_omp:1:6:0.107365 +10000:gen_omp:1:6:0.125315 +10000:gen_omp:1:6:0.158631 +10000:gen_omp:1:6:0.108178 +10000:gen_omp:1:6:0.17615 +10000:gen_omp:1:6:0.111336 +100000:gen_omp:1:6:1.26616 +100000:gen_omp:1:6:1.48091 +100000:gen_omp:1:6:1.45535 +100000:gen_omp:1:6:1.59312 +100000:gen_omp:1:6:1.38384 +100000:gen_omp:1:6:1.44786 +100000:gen_omp:1:6:1.47913 +100000:gen_omp:1:6:1.39353 +100000:gen_omp:1:6:1.5285 +100000:gen_omp:1:6:1.42463 +100000:gen_omp:1:6:1.39333 +100000:gen_omp:1:6:1.38066 +100000:gen_omp:1:6:1.49226 +100000:gen_omp:1:6:1.5256 +100000:gen_omp:1:6:1.49289 +100000:gen_omp:1:6:1.43251 +100000:gen_omp:1:6:1.51053 +100000:gen_omp:1:6:1.55696 +100000:gen_omp:1:6:1.42668 +100000:gen_omp:1:6:1.38008 +1000000:gen_omp:1:6:8.72654 +1000000:gen_omp:1:6:9.13053 +1000000:gen_omp:1:6:8.406 +1000000:gen_omp:1:6:9.02331 +1000000:gen_omp:1:6:8.39838 +1000000:gen_omp:1:6:8.33127 +1000000:gen_omp:1:6:8.48462 +1000000:gen_omp:1:6:8.67158 +1000000:gen_omp:1:6:7.61185 +1000000:gen_omp:1:6:8.61083 +1000000:gen_omp:1:6:8.9588 +1000000:gen_omp:1:6:9.18044 +1000000:gen_omp:1:6:9.1794 +1000000:gen_omp:1:6:8.94751 +1000000:gen_omp:1:6:7.07553 +1000000:gen_omp:1:6:7.69797 +1000000:gen_omp:1:6:8.49612 +1000000:gen_omp:1:6:8.02488 +1000000:gen_omp:1:6:8.26102 +1000000:gen_omp:1:6:8.92512 +10000000:gen_omp:1:6:81.373 +10000000:gen_omp:1:6:81.1184 +10000000:gen_omp:1:6:81.0028 +10000000:gen_omp:1:6:80.6323 +10000000:gen_omp:1:6:81.1819 +10000000:gen_omp:1:6:79.8152 +10000000:gen_omp:1:6:80.1478 +10000000:gen_omp:1:6:81.1297 +10000000:gen_omp:1:6:80.0156 +10000000:gen_omp:1:6:81.3409 +10000000:gen_omp:1:6:81.249 +10000000:gen_omp:1:6:80.4047 +10000000:gen_omp:1:6:79.931 +10000000:gen_omp:1:6:80.6837 +10000000:gen_omp:1:6:80.9444 +10000000:gen_omp:1:6:80.4201 +10000000:gen_omp:1:6:80.2888 +10000000:gen_omp:1:6:80.4101 +10000000:gen_omp:1:6:80.3211 +10000000:gen_omp:1:6:79.8947 diff --git a/results/rt/data_basic/rt_size_6_gen_thread b/results/rt/data_basic/rt_size_6_gen_thread new file mode 100644 index 0000000..0063c7b --- /dev/null +++ b/results/rt/data_basic/rt_size_6_gen_thread @@ -0,0 +1,120 @@ +100:gen_thread:1:6:0.217013 +100:gen_thread:1:6:0.194992 +100:gen_thread:1:6:0.206753 +100:gen_thread:1:6:0.241566 +100:gen_thread:1:6:0.220373 +100:gen_thread:1:6:0.237405 +100:gen_thread:1:6:0.218288 +100:gen_thread:1:6:0.221019 +100:gen_thread:1:6:0.262013 +100:gen_thread:1:6:0.249194 +100:gen_thread:1:6:0.253301 +100:gen_thread:1:6:0.233103 +100:gen_thread:1:6:0.244119 +100:gen_thread:1:6:0.22483 +100:gen_thread:1:6:0.230743 +100:gen_thread:1:6:0.234113 +100:gen_thread:1:6:0.225187 +100:gen_thread:1:6:0.226015 +100:gen_thread:1:6:0.255239 +100:gen_thread:1:6:0.241538 +1000:gen_thread:1:6:0.253436 +1000:gen_thread:1:6:0.261927 +1000:gen_thread:1:6:0.245527 +1000:gen_thread:1:6:0.245198 +1000:gen_thread:1:6:0.232946 +1000:gen_thread:1:6:0.234362 +1000:gen_thread:1:6:0.253268 +1000:gen_thread:1:6:0.265013 +1000:gen_thread:1:6:0.259052 +1000:gen_thread:1:6:0.271353 +1000:gen_thread:1:6:0.268267 +1000:gen_thread:1:6:0.272094 +1000:gen_thread:1:6:0.272802 +1000:gen_thread:1:6:0.249144 +1000:gen_thread:1:6:0.265494 +1000:gen_thread:1:6:0.264192 +1000:gen_thread:1:6:0.235863 +1000:gen_thread:1:6:0.233634 +1000:gen_thread:1:6:0.237148 +1000:gen_thread:1:6:0.23292 +10000:gen_thread:1:6:0.276894 +10000:gen_thread:1:6:0.273921 +10000:gen_thread:1:6:0.27211 +10000:gen_thread:1:6:0.275469 +10000:gen_thread:1:6:0.283407 +10000:gen_thread:1:6:0.275242 +10000:gen_thread:1:6:0.279827 +10000:gen_thread:1:6:0.271004 +10000:gen_thread:1:6:0.273132 +10000:gen_thread:1:6:0.272675 +10000:gen_thread:1:6:0.272099 +10000:gen_thread:1:6:0.275237 +10000:gen_thread:1:6:0.272844 +10000:gen_thread:1:6:0.273317 +10000:gen_thread:1:6:0.272267 +10000:gen_thread:1:6:0.274848 +10000:gen_thread:1:6:0.288944 +10000:gen_thread:1:6:0.272474 +10000:gen_thread:1:6:0.280364 +10000:gen_thread:1:6:0.272389 +100000:gen_thread:1:6:1.34436 +100000:gen_thread:1:6:1.86888 +100000:gen_thread:1:6:1.8796 +100000:gen_thread:1:6:1.84294 +100000:gen_thread:1:6:1.88961 +100000:gen_thread:1:6:1.55078 +100000:gen_thread:1:6:1.85259 +100000:gen_thread:1:6:1.82956 +100000:gen_thread:1:6:1.62331 +100000:gen_thread:1:6:1.91978 +100000:gen_thread:1:6:1.71057 +100000:gen_thread:1:6:1.44334 +100000:gen_thread:1:6:1.36418 +100000:gen_thread:1:6:1.59059 +100000:gen_thread:1:6:1.80771 +100000:gen_thread:1:6:1.90226 +100000:gen_thread:1:6:1.8741 +100000:gen_thread:1:6:1.84744 +100000:gen_thread:1:6:1.81929 +100000:gen_thread:1:6:1.82712 +1000000:gen_thread:1:6:7.93675 +1000000:gen_thread:1:6:8.02984 +1000000:gen_thread:1:6:7.99855 +1000000:gen_thread:1:6:8.2248 +1000000:gen_thread:1:6:7.46515 +1000000:gen_thread:1:6:7.88055 +1000000:gen_thread:1:6:8.01981 +1000000:gen_thread:1:6:8.1421 +1000000:gen_thread:1:6:7.9101 +1000000:gen_thread:1:6:8.0861 +1000000:gen_thread:1:6:8.11077 +1000000:gen_thread:1:6:8.18985 +1000000:gen_thread:1:6:7.60048 +1000000:gen_thread:1:6:8.26237 +1000000:gen_thread:1:6:7.61121 +1000000:gen_thread:1:6:8.04496 +1000000:gen_thread:1:6:7.89779 +1000000:gen_thread:1:6:7.40039 +1000000:gen_thread:1:6:7.97991 +1000000:gen_thread:1:6:8.02621 +10000000:gen_thread:1:6:87.7383 +10000000:gen_thread:1:6:85.8329 +10000000:gen_thread:1:6:87.2215 +10000000:gen_thread:1:6:87.2558 +10000000:gen_thread:1:6:86.5752 +10000000:gen_thread:1:6:85.1107 +10000000:gen_thread:1:6:85.249 +10000000:gen_thread:1:6:86.1593 +10000000:gen_thread:1:6:87.0084 +10000000:gen_thread:1:6:84.1825 +10000000:gen_thread:1:6:87.6619 +10000000:gen_thread:1:6:85.7827 +10000000:gen_thread:1:6:87.0444 +10000000:gen_thread:1:6:86.9104 +10000000:gen_thread:1:6:85.9316 +10000000:gen_thread:1:6:85.892 +10000000:gen_thread:1:6:87.9146 +10000000:gen_thread:1:6:84.2389 +10000000:gen_thread:1:6:85.8378 +10000000:gen_thread:1:6:84.9408 diff --git a/results/rt/data_basic/rt_size_6_omp b/results/rt/data_basic/rt_size_6_omp new file mode 100644 index 0000000..40d2fc1 --- /dev/null +++ b/results/rt/data_basic/rt_size_6_omp @@ -0,0 +1,120 @@ +100:omp:1:6:0.104806 +100:omp:1:6:0.089467 +100:omp:1:6:0.092486 +100:omp:1:6:0.086439 +100:omp:1:6:0.088178 +100:omp:1:6:0.050818 +100:omp:1:6:0.096514 +100:omp:1:6:0.094019 +100:omp:1:6:0.088469 +100:omp:1:6:0.08522 +100:omp:1:6:0.083623 +100:omp:1:6:0.054838 +100:omp:1:6:0.090662 +100:omp:1:6:0.064305 +100:omp:1:6:0.091892 +100:omp:1:6:0.087316 +100:omp:1:6:0.085448 +100:omp:1:6:0.07425 +100:omp:1:6:0.083889 +100:omp:1:6:0.088022 +1000:omp:1:6:0.071428 +1000:omp:1:6:0.105474 +1000:omp:1:6:0.102411 +1000:omp:1:6:0.099062 +1000:omp:1:6:0.097311 +1000:omp:1:6:0.096033 +1000:omp:1:6:0.096838 +1000:omp:1:6:0.096249 +1000:omp:1:6:0.096193 +1000:omp:1:6:0.08652 +1000:omp:1:6:0.099343 +1000:omp:1:6:0.097429 +1000:omp:1:6:0.096784 +1000:omp:1:6:0.064641 +1000:omp:1:6:0.107475 +1000:omp:1:6:0.100914 +1000:omp:1:6:0.101571 +1000:omp:1:6:0.09765 +1000:omp:1:6:0.095314 +1000:omp:1:6:0.072365 +10000:omp:1:6:0.135378 +10000:omp:1:6:0.103151 +10000:omp:1:6:0.098524 +10000:omp:1:6:0.154514 +10000:omp:1:6:0.138513 +10000:omp:1:6:0.128029 +10000:omp:1:6:0.091329 +10000:omp:1:6:0.141333 +10000:omp:1:6:0.112233 +10000:omp:1:6:0.14601 +10000:omp:1:6:0.132994 +10000:omp:1:6:0.108255 +10000:omp:1:6:0.143661 +10000:omp:1:6:0.129201 +10000:omp:1:6:0.116438 +10000:omp:1:6:0.094636 +10000:omp:1:6:0.153634 +10000:omp:1:6:0.097846 +10000:omp:1:6:0.139965 +10000:omp:1:6:0.097571 +100000:omp:1:6:1.21023 +100000:omp:1:6:1.36804 +100000:omp:1:6:1.36511 +100000:omp:1:6:1.36512 +100000:omp:1:6:1.40615 +100000:omp:1:6:1.3216 +100000:omp:1:6:1.37508 +100000:omp:1:6:1.41963 +100000:omp:1:6:1.28879 +100000:omp:1:6:1.39633 +100000:omp:1:6:1.25275 +100000:omp:1:6:1.27645 +100000:omp:1:6:1.39457 +100000:omp:1:6:1.41767 +100000:omp:1:6:1.40922 +100000:omp:1:6:1.33873 +100000:omp:1:6:1.29943 +100000:omp:1:6:1.38957 +100000:omp:1:6:1.39252 +100000:omp:1:6:1.32337 +1000000:omp:1:6:8.16777 +1000000:omp:1:6:7.12501 +1000000:omp:1:6:7.50749 +1000000:omp:1:6:7.30439 +1000000:omp:1:6:6.96337 +1000000:omp:1:6:7.42895 +1000000:omp:1:6:7.15167 +1000000:omp:1:6:7.50004 +1000000:omp:1:6:7.53732 +1000000:omp:1:6:7.42723 +1000000:omp:1:6:7.45032 +1000000:omp:1:6:7.14515 +1000000:omp:1:6:7.54439 +1000000:omp:1:6:7.51546 +1000000:omp:1:6:7.29311 +1000000:omp:1:6:7.44425 +1000000:omp:1:6:7.65735 +1000000:omp:1:6:7.48953 +1000000:omp:1:6:7.42283 +1000000:omp:1:6:7.391 +10000000:omp:1:6:77.6639 +10000000:omp:1:6:77.4953 +10000000:omp:1:6:78.8727 +10000000:omp:1:6:78.6293 +10000000:omp:1:6:76.444 +10000000:omp:1:6:79.2924 +10000000:omp:1:6:78.381 +10000000:omp:1:6:77.6905 +10000000:omp:1:6:77.0155 +10000000:omp:1:6:78.1789 +10000000:omp:1:6:77.4339 +10000000:omp:1:6:76.6048 +10000000:omp:1:6:78.3613 +10000000:omp:1:6:77.2553 +10000000:omp:1:6:77.4199 +10000000:omp:1:6:78.9743 +10000000:omp:1:6:77.1103 +10000000:omp:1:6:78.8266 +10000000:omp:1:6:78.1428 +10000000:omp:1:6:78.6725 diff --git a/results/rt/data_basic/rt_size_6_seq b/results/rt/data_basic/rt_size_6_seq new file mode 100644 index 0000000..1643e20 --- /dev/null +++ b/results/rt/data_basic/rt_size_6_seq @@ -0,0 +1,120 @@ +100:seq:1:6:0.000505 +100:seq:1:6:0.000501 +100:seq:1:6:0.000499 +100:seq:1:6:0.000487 +100:seq:1:6:0.000499 +100:seq:1:6:0.000492 +100:seq:1:6:0.000506 +100:seq:1:6:0.000488 +100:seq:1:6:0.000474 +100:seq:1:6:0.000476 +100:seq:1:6:0.000473 +100:seq:1:6:0.000492 +100:seq:1:6:0.000488 +100:seq:1:6:0.000522 +100:seq:1:6:0.000529 +100:seq:1:6:0.000522 +100:seq:1:6:0.000536 +100:seq:1:6:0.000522 +100:seq:1:6:0.000533 +100:seq:1:6:0.000519 +1000:seq:1:6:0.005139 +1000:seq:1:6:0.005145 +1000:seq:1:6:0.004848 +1000:seq:1:6:0.004832 +1000:seq:1:6:0.004821 +1000:seq:1:6:0.004831 +1000:seq:1:6:0.004846 +1000:seq:1:6:0.004827 +1000:seq:1:6:0.00457 +1000:seq:1:6:0.004567 +1000:seq:1:6:0.004317 +1000:seq:1:6:0.004325 +1000:seq:1:6:0.004323 +1000:seq:1:6:0.004324 +1000:seq:1:6:0.004315 +1000:seq:1:6:0.004309 +1000:seq:1:6:0.004336 +1000:seq:1:6:0.004329 +1000:seq:1:6:0.004113 +1000:seq:1:6:0.003906 +10000:seq:1:6:0.038432 +10000:seq:1:6:0.03539 +10000:seq:1:6:0.025383 +10000:seq:1:6:0.025363 +10000:seq:1:6:0.025441 +10000:seq:1:6:0.025411 +10000:seq:1:6:0.02555 +10000:seq:1:6:0.02542 +10000:seq:1:6:0.025437 +10000:seq:1:6:0.025558 +10000:seq:1:6:0.025551 +10000:seq:1:6:0.025405 +10000:seq:1:6:0.025392 +10000:seq:1:6:0.025501 +10000:seq:1:6:0.025453 +10000:seq:1:6:0.02556 +10000:seq:1:6:0.025474 +10000:seq:1:6:0.025396 +10000:seq:1:6:0.025533 +10000:seq:1:6:0.025474 +100000:seq:1:6:0.537404 +100000:seq:1:6:0.537996 +100000:seq:1:6:0.540014 +100000:seq:1:6:0.536818 +100000:seq:1:6:0.540188 +100000:seq:1:6:0.549046 +100000:seq:1:6:0.53565 +100000:seq:1:6:0.545738 +100000:seq:1:6:0.542096 +100000:seq:1:6:0.537335 +100000:seq:1:6:0.534841 +100000:seq:1:6:0.546737 +100000:seq:1:6:0.539084 +100000:seq:1:6:0.537398 +100000:seq:1:6:0.538214 +100000:seq:1:6:0.527603 +100000:seq:1:6:0.534906 +100000:seq:1:6:0.531287 +100000:seq:1:6:0.532418 +100000:seq:1:6:0.536411 +1000000:seq:1:6:5.38862 +1000000:seq:1:6:5.37697 +1000000:seq:1:6:5.38437 +1000000:seq:1:6:5.37241 +1000000:seq:1:6:5.3685 +1000000:seq:1:6:5.37998 +1000000:seq:1:6:5.41481 +1000000:seq:1:6:5.39985 +1000000:seq:1:6:5.40377 +1000000:seq:1:6:5.39247 +1000000:seq:1:6:5.38987 +1000000:seq:1:6:5.42308 +1000000:seq:1:6:5.41401 +1000000:seq:1:6:5.40076 +1000000:seq:1:6:5.36065 +1000000:seq:1:6:5.35528 +1000000:seq:1:6:5.37869 +1000000:seq:1:6:5.36168 +1000000:seq:1:6:5.39924 +1000000:seq:1:6:5.38399 +10000000:seq:1:6:61.1839 +10000000:seq:1:6:61.2506 +10000000:seq:1:6:61.1693 +10000000:seq:1:6:61.3879 +10000000:seq:1:6:61.2464 +10000000:seq:1:6:61.2939 +10000000:seq:1:6:61.2917 +10000000:seq:1:6:61.3692 +10000000:seq:1:6:61.242 +10000000:seq:1:6:61.364 +10000000:seq:1:6:61.3257 +10000000:seq:1:6:61.3103 +10000000:seq:1:6:61.2757 +10000000:seq:1:6:61.3052 +10000000:seq:1:6:61.3352 +10000000:seq:1:6:61.3124 +10000000:seq:1:6:61.2978 +10000000:seq:1:6:61.2595 +10000000:seq:1:6:61.3021 +10000000:seq:1:6:61.284 diff --git a/results/rt/data_basic/rt_size_8_gen_omp b/results/rt/data_basic/rt_size_8_gen_omp new file mode 100644 index 0000000..392b98a --- /dev/null +++ b/results/rt/data_basic/rt_size_8_gen_omp @@ -0,0 +1,120 @@ +100:gen_omp:1:8:0.118789 +100:gen_omp:1:8:0.100657 +100:gen_omp:1:8:0.076452 +100:gen_omp:1:8:0.085588 +100:gen_omp:1:8:0.09385 +100:gen_omp:1:8:0.079067 +100:gen_omp:1:8:0.083766 +100:gen_omp:1:8:0.082831 +100:gen_omp:1:8:0.079009 +100:gen_omp:1:8:0.081621 +100:gen_omp:1:8:0.082046 +100:gen_omp:1:8:0.071452 +100:gen_omp:1:8:0.125817 +100:gen_omp:1:8:0.09575 +100:gen_omp:1:8:0.099086 +100:gen_omp:1:8:0.082974 +100:gen_omp:1:8:0.108154 +100:gen_omp:1:8:0.074761 +100:gen_omp:1:8:0.073922 +100:gen_omp:1:8:0.117514 +1000:gen_omp:1:8:0.105536 +1000:gen_omp:1:8:0.105544 +1000:gen_omp:1:8:0.097997 +1000:gen_omp:1:8:0.109944 +1000:gen_omp:1:8:0.112085 +1000:gen_omp:1:8:0.103967 +1000:gen_omp:1:8:0.095693 +1000:gen_omp:1:8:0.088274 +1000:gen_omp:1:8:0.1286 +1000:gen_omp:1:8:0.082084 +1000:gen_omp:1:8:0.122974 +1000:gen_omp:1:8:0.098827 +1000:gen_omp:1:8:0.097724 +1000:gen_omp:1:8:0.109593 +1000:gen_omp:1:8:0.11024 +1000:gen_omp:1:8:0.067599 +1000:gen_omp:1:8:0.131189 +1000:gen_omp:1:8:0.129829 +1000:gen_omp:1:8:0.105518 +1000:gen_omp:1:8:0.113975 +10000:gen_omp:1:8:0.170551 +10000:gen_omp:1:8:0.159201 +10000:gen_omp:1:8:0.12145 +10000:gen_omp:1:8:0.170754 +10000:gen_omp:1:8:0.158252 +10000:gen_omp:1:8:0.128007 +10000:gen_omp:1:8:0.201033 +10000:gen_omp:1:8:0.197063 +10000:gen_omp:1:8:0.227783 +10000:gen_omp:1:8:0.195037 +10000:gen_omp:1:8:0.203144 +10000:gen_omp:1:8:0.181624 +10000:gen_omp:1:8:0.224616 +10000:gen_omp:1:8:0.242781 +10000:gen_omp:1:8:0.222128 +10000:gen_omp:1:8:0.187205 +10000:gen_omp:1:8:0.235146 +10000:gen_omp:1:8:0.216116 +10000:gen_omp:1:8:0.219843 +10000:gen_omp:1:8:0.251048 +100000:gen_omp:1:8:1.67566 +100000:gen_omp:1:8:1.68477 +100000:gen_omp:1:8:1.47728 +100000:gen_omp:1:8:1.56296 +100000:gen_omp:1:8:1.67432 +100000:gen_omp:1:8:1.70472 +100000:gen_omp:1:8:1.7056 +100000:gen_omp:1:8:1.59525 +100000:gen_omp:1:8:1.56419 +100000:gen_omp:1:8:1.50729 +100000:gen_omp:1:8:1.65109 +100000:gen_omp:1:8:1.72418 +100000:gen_omp:1:8:1.7162 +100000:gen_omp:1:8:1.62048 +100000:gen_omp:1:8:1.54186 +100000:gen_omp:1:8:1.50817 +100000:gen_omp:1:8:1.62787 +100000:gen_omp:1:8:1.56212 +100000:gen_omp:1:8:1.65203 +100000:gen_omp:1:8:1.715 +1000000:gen_omp:1:8:7.10571 +1000000:gen_omp:1:8:6.6109 +1000000:gen_omp:1:8:6.94583 +1000000:gen_omp:1:8:6.94548 +1000000:gen_omp:1:8:7.29581 +1000000:gen_omp:1:8:6.62127 +1000000:gen_omp:1:8:6.77311 +1000000:gen_omp:1:8:6.90928 +1000000:gen_omp:1:8:6.74418 +1000000:gen_omp:1:8:6.75154 +1000000:gen_omp:1:8:6.66804 +1000000:gen_omp:1:8:6.70797 +1000000:gen_omp:1:8:7.1332 +1000000:gen_omp:1:8:6.71705 +1000000:gen_omp:1:8:6.75093 +1000000:gen_omp:1:8:6.67212 +1000000:gen_omp:1:8:6.93779 +1000000:gen_omp:1:8:6.81802 +1000000:gen_omp:1:8:6.84767 +1000000:gen_omp:1:8:6.66467 +10000000:gen_omp:1:8:69.4193 +10000000:gen_omp:1:8:69.4737 +10000000:gen_omp:1:8:69.6184 +10000000:gen_omp:1:8:70.0232 +10000000:gen_omp:1:8:70.0169 +10000000:gen_omp:1:8:69.7826 +10000000:gen_omp:1:8:69.0676 +10000000:gen_omp:1:8:69.3179 +10000000:gen_omp:1:8:69.7538 +10000000:gen_omp:1:8:69.0514 +10000000:gen_omp:1:8:69.697 +10000000:gen_omp:1:8:69.4851 +10000000:gen_omp:1:8:69.4408 +10000000:gen_omp:1:8:69.3 +10000000:gen_omp:1:8:69.4193 +10000000:gen_omp:1:8:69.0917 +10000000:gen_omp:1:8:69.434 +10000000:gen_omp:1:8:69.3462 +10000000:gen_omp:1:8:69.2243 +10000000:gen_omp:1:8:69.5571 diff --git a/results/rt/data_basic/rt_size_8_gen_thread b/results/rt/data_basic/rt_size_8_gen_thread new file mode 100644 index 0000000..114640b --- /dev/null +++ b/results/rt/data_basic/rt_size_8_gen_thread @@ -0,0 +1,120 @@ +100:gen_thread:1:8:0.340924 +100:gen_thread:1:8:0.389325 +100:gen_thread:1:8:0.388857 +100:gen_thread:1:8:0.401729 +100:gen_thread:1:8:0.410044 +100:gen_thread:1:8:0.349126 +100:gen_thread:1:8:0.375641 +100:gen_thread:1:8:0.38577 +100:gen_thread:1:8:0.375497 +100:gen_thread:1:8:0.354056 +100:gen_thread:1:8:0.402729 +100:gen_thread:1:8:0.374463 +100:gen_thread:1:8:0.402625 +100:gen_thread:1:8:0.397702 +100:gen_thread:1:8:0.354205 +100:gen_thread:1:8:0.374066 +100:gen_thread:1:8:0.389624 +100:gen_thread:1:8:0.371744 +100:gen_thread:1:8:0.376103 +100:gen_thread:1:8:0.395989 +1000:gen_thread:1:8:0.437126 +1000:gen_thread:1:8:0.396484 +1000:gen_thread:1:8:0.392807 +1000:gen_thread:1:8:0.430874 +1000:gen_thread:1:8:0.41454 +1000:gen_thread:1:8:0.42063 +1000:gen_thread:1:8:0.451311 +1000:gen_thread:1:8:0.400773 +1000:gen_thread:1:8:0.371648 +1000:gen_thread:1:8:0.384309 +1000:gen_thread:1:8:0.392641 +1000:gen_thread:1:8:0.401619 +1000:gen_thread:1:8:0.378064 +1000:gen_thread:1:8:0.404287 +1000:gen_thread:1:8:0.392298 +1000:gen_thread:1:8:0.365061 +1000:gen_thread:1:8:0.383583 +1000:gen_thread:1:8:0.419755 +1000:gen_thread:1:8:0.363592 +1000:gen_thread:1:8:0.403998 +10000:gen_thread:1:8:0.472906 +10000:gen_thread:1:8:0.440459 +10000:gen_thread:1:8:0.428563 +10000:gen_thread:1:8:0.454027 +10000:gen_thread:1:8:0.425324 +10000:gen_thread:1:8:0.418936 +10000:gen_thread:1:8:0.434661 +10000:gen_thread:1:8:0.44663 +10000:gen_thread:1:8:0.44553 +10000:gen_thread:1:8:0.402016 +10000:gen_thread:1:8:0.416437 +10000:gen_thread:1:8:0.419662 +10000:gen_thread:1:8:0.41863 +10000:gen_thread:1:8:0.439363 +10000:gen_thread:1:8:0.414834 +10000:gen_thread:1:8:0.426218 +10000:gen_thread:1:8:0.423059 +10000:gen_thread:1:8:0.427052 +10000:gen_thread:1:8:0.437256 +10000:gen_thread:1:8:0.427203 +100000:gen_thread:1:8:1.3688 +100000:gen_thread:1:8:1.51825 +100000:gen_thread:1:8:1.49648 +100000:gen_thread:1:8:1.57494 +100000:gen_thread:1:8:1.5688 +100000:gen_thread:1:8:1.48852 +100000:gen_thread:1:8:1.52929 +100000:gen_thread:1:8:1.77927 +100000:gen_thread:1:8:1.75592 +100000:gen_thread:1:8:1.6951 +100000:gen_thread:1:8:1.75746 +100000:gen_thread:1:8:1.74327 +100000:gen_thread:1:8:1.76704 +100000:gen_thread:1:8:1.7618 +100000:gen_thread:1:8:1.81484 +100000:gen_thread:1:8:1.81684 +100000:gen_thread:1:8:1.81321 +100000:gen_thread:1:8:1.74121 +100000:gen_thread:1:8:1.73521 +100000:gen_thread:1:8:1.78279 +1000000:gen_thread:1:8:7.3714 +1000000:gen_thread:1:8:6.88339 +1000000:gen_thread:1:8:6.97308 +1000000:gen_thread:1:8:6.86269 +1000000:gen_thread:1:8:7.06999 +1000000:gen_thread:1:8:6.93899 +1000000:gen_thread:1:8:6.93356 +1000000:gen_thread:1:8:7.00021 +1000000:gen_thread:1:8:6.90962 +1000000:gen_thread:1:8:6.96854 +1000000:gen_thread:1:8:6.92895 +1000000:gen_thread:1:8:6.99571 +1000000:gen_thread:1:8:7.06657 +1000000:gen_thread:1:8:6.94186 +1000000:gen_thread:1:8:7.51146 +1000000:gen_thread:1:8:7.12363 +1000000:gen_thread:1:8:6.87104 +1000000:gen_thread:1:8:6.78753 +1000000:gen_thread:1:8:6.96024 +1000000:gen_thread:1:8:7.01816 +10000000:gen_thread:1:8:94.011 +10000000:gen_thread:1:8:91.7827 +10000000:gen_thread:1:8:91.6969 +10000000:gen_thread:1:8:92.5384 +10000000:gen_thread:1:8:93.1056 +10000000:gen_thread:1:8:91.9936 +10000000:gen_thread:1:8:93.9685 +10000000:gen_thread:1:8:94.1123 +10000000:gen_thread:1:8:96.2042 +10000000:gen_thread:1:8:92.4209 +10000000:gen_thread:1:8:92.4509 +10000000:gen_thread:1:8:93.897 +10000000:gen_thread:1:8:93.3829 +10000000:gen_thread:1:8:93.2242 +10000000:gen_thread:1:8:94.5016 +10000000:gen_thread:1:8:92.934 +10000000:gen_thread:1:8:93.0528 +10000000:gen_thread:1:8:94.311 +10000000:gen_thread:1:8:94.7616 +10000000:gen_thread:1:8:92.3833 diff --git a/results/rt/data_basic/rt_size_8_omp b/results/rt/data_basic/rt_size_8_omp new file mode 100644 index 0000000..4cb6508 --- /dev/null +++ b/results/rt/data_basic/rt_size_8_omp @@ -0,0 +1,120 @@ +100:omp:1:8:0.108723 +100:omp:1:8:0.12747 +100:omp:1:8:0.102886 +100:omp:1:8:0.090248 +100:omp:1:8:0.098726 +100:omp:1:8:0.073745 +100:omp:1:8:0.101237 +100:omp:1:8:0.115437 +100:omp:1:8:0.09047 +100:omp:1:8:0.07396 +100:omp:1:8:0.090352 +100:omp:1:8:0.091704 +100:omp:1:8:0.068921 +100:omp:1:8:0.069266 +100:omp:1:8:0.117007 +100:omp:1:8:0.092639 +100:omp:1:8:0.095101 +100:omp:1:8:0.092621 +100:omp:1:8:0.085 +100:omp:1:8:0.086933 +1000:omp:1:8:0.105019 +1000:omp:1:8:0.102159 +1000:omp:1:8:0.112056 +1000:omp:1:8:0.108835 +1000:omp:1:8:0.097744 +1000:omp:1:8:0.106255 +1000:omp:1:8:0.10547 +1000:omp:1:8:0.086265 +1000:omp:1:8:0.117526 +1000:omp:1:8:0.099563 +1000:omp:1:8:0.100238 +1000:omp:1:8:0.097738 +1000:omp:1:8:0.09113 +1000:omp:1:8:0.094873 +1000:omp:1:8:0.11391 +1000:omp:1:8:0.098642 +1000:omp:1:8:0.083179 +1000:omp:1:8:0.082358 +1000:omp:1:8:0.084233 +1000:omp:1:8:0.137564 +10000:omp:1:8:0.197373 +10000:omp:1:8:0.197986 +10000:omp:1:8:0.181358 +10000:omp:1:8:0.170417 +10000:omp:1:8:0.201933 +10000:omp:1:8:0.194577 +10000:omp:1:8:0.164885 +10000:omp:1:8:0.210169 +10000:omp:1:8:0.191133 +10000:omp:1:8:0.196386 +10000:omp:1:8:0.179401 +10000:omp:1:8:0.20278 +10000:omp:1:8:0.219177 +10000:omp:1:8:0.21231 +10000:omp:1:8:0.215292 +10000:omp:1:8:0.199671 +10000:omp:1:8:0.18145 +10000:omp:1:8:0.204221 +10000:omp:1:8:0.192202 +10000:omp:1:8:0.169301 +100000:omp:1:8:1.29406 +100000:omp:1:8:1.45916 +100000:omp:1:8:1.50439 +100000:omp:1:8:1.4449 +100000:omp:1:8:1.49756 +100000:omp:1:8:1.49951 +100000:omp:1:8:1.51166 +100000:omp:1:8:1.45056 +100000:omp:1:8:1.51857 +100000:omp:1:8:1.50431 +100000:omp:1:8:1.44444 +100000:omp:1:8:1.48628 +100000:omp:1:8:1.50947 +100000:omp:1:8:1.4601 +100000:omp:1:8:1.39933 +100000:omp:1:8:1.41752 +100000:omp:1:8:1.52861 +100000:omp:1:8:1.51627 +100000:omp:1:8:1.45336 +100000:omp:1:8:1.5048 +1000000:omp:1:8:6.17137 +1000000:omp:1:8:6.16269 +1000000:omp:1:8:6.01637 +1000000:omp:1:8:6.12345 +1000000:omp:1:8:6.00212 +1000000:omp:1:8:5.9756 +1000000:omp:1:8:6.60463 +1000000:omp:1:8:6.24685 +1000000:omp:1:8:6.16444 +1000000:omp:1:8:5.95337 +1000000:omp:1:8:5.87794 +1000000:omp:1:8:6.05769 +1000000:omp:1:8:6.02756 +1000000:omp:1:8:5.99745 +1000000:omp:1:8:5.91851 +1000000:omp:1:8:5.93979 +1000000:omp:1:8:5.96755 +1000000:omp:1:8:6.17383 +1000000:omp:1:8:5.95083 +1000000:omp:1:8:6.27899 +10000000:omp:1:8:64.7916 +10000000:omp:1:8:64.454 +10000000:omp:1:8:64.6599 +10000000:omp:1:8:65.0596 +10000000:omp:1:8:64.4715 +10000000:omp:1:8:64.544 +10000000:omp:1:8:64.8126 +10000000:omp:1:8:64.681 +10000000:omp:1:8:64.6679 +10000000:omp:1:8:64.5198 +10000000:omp:1:8:64.778 +10000000:omp:1:8:64.9633 +10000000:omp:1:8:64.5196 +10000000:omp:1:8:64.6437 +10000000:omp:1:8:64.3168 +10000000:omp:1:8:64.801 +10000000:omp:1:8:64.8734 +10000000:omp:1:8:64.5454 +10000000:omp:1:8:64.5266 +10000000:omp:1:8:64.7706 diff --git a/results/rt/data_basic/rt_size_8_seq b/results/rt/data_basic/rt_size_8_seq new file mode 100644 index 0000000..8674ee8 --- /dev/null +++ b/results/rt/data_basic/rt_size_8_seq @@ -0,0 +1,120 @@ +100:seq:1:8:0.000497 +100:seq:1:8:0.000461 +100:seq:1:8:0.000472 +100:seq:1:8:0.000465 +100:seq:1:8:0.000462 +100:seq:1:8:0.000469 +100:seq:1:8:0.000447 +100:seq:1:8:0.000472 +100:seq:1:8:0.000448 +100:seq:1:8:0.000448 +100:seq:1:8:0.00044 +100:seq:1:8:0.000436 +100:seq:1:8:0.000452 +100:seq:1:8:0.000454 +100:seq:1:8:0.000464 +100:seq:1:8:0.000507 +100:seq:1:8:0.000488 +100:seq:1:8:0.000501 +100:seq:1:8:0.000492 +100:seq:1:8:0.000501 +1000:seq:1:8:0.00484 +1000:seq:1:8:0.004842 +1000:seq:1:8:0.00483 +1000:seq:1:8:0.004582 +1000:seq:1:8:0.004567 +1000:seq:1:8:0.004556 +1000:seq:1:8:0.004322 +1000:seq:1:8:0.004313 +1000:seq:1:8:0.004326 +1000:seq:1:8:0.004333 +1000:seq:1:8:0.004339 +1000:seq:1:8:0.004325 +1000:seq:1:8:0.004321 +1000:seq:1:8:0.004335 +1000:seq:1:8:0.004328 +1000:seq:1:8:0.00411 +1000:seq:1:8:0.00411 +1000:seq:1:8:0.003918 +1000:seq:1:8:0.00391 +1000:seq:1:8:0.003918 +10000:seq:1:8:0.035658 +10000:seq:1:8:0.029964 +10000:seq:1:8:0.025487 +10000:seq:1:8:0.025446 +10000:seq:1:8:0.025361 +10000:seq:1:8:0.025352 +10000:seq:1:8:0.025566 +10000:seq:1:8:0.025527 +10000:seq:1:8:0.025634 +10000:seq:1:8:0.025515 +10000:seq:1:8:0.025519 +10000:seq:1:8:0.025728 +10000:seq:1:8:0.025557 +10000:seq:1:8:0.025688 +10000:seq:1:8:0.025546 +10000:seq:1:8:0.02557 +10000:seq:1:8:0.025596 +10000:seq:1:8:0.025525 +10000:seq:1:8:0.025378 +10000:seq:1:8:0.02562 +100000:seq:1:8:0.538395 +100000:seq:1:8:0.532267 +100000:seq:1:8:0.539062 +100000:seq:1:8:0.535304 +100000:seq:1:8:0.537047 +100000:seq:1:8:0.532842 +100000:seq:1:8:0.532184 +100000:seq:1:8:0.53143 +100000:seq:1:8:0.533082 +100000:seq:1:8:0.535187 +100000:seq:1:8:0.540601 +100000:seq:1:8:0.535671 +100000:seq:1:8:0.533066 +100000:seq:1:8:0.533028 +100000:seq:1:8:0.535359 +100000:seq:1:8:0.533594 +100000:seq:1:8:0.535316 +100000:seq:1:8:0.532122 +100000:seq:1:8:0.535746 +100000:seq:1:8:0.541444 +1000000:seq:1:8:5.40867 +1000000:seq:1:8:5.39121 +1000000:seq:1:8:5.38888 +1000000:seq:1:8:5.41182 +1000000:seq:1:8:5.37186 +1000000:seq:1:8:5.38208 +1000000:seq:1:8:5.40705 +1000000:seq:1:8:5.40229 +1000000:seq:1:8:5.40189 +1000000:seq:1:8:5.3805 +1000000:seq:1:8:5.40417 +1000000:seq:1:8:5.38948 +1000000:seq:1:8:5.40516 +1000000:seq:1:8:5.41558 +1000000:seq:1:8:5.37839 +1000000:seq:1:8:5.39781 +1000000:seq:1:8:5.40217 +1000000:seq:1:8:5.37751 +1000000:seq:1:8:5.37064 +1000000:seq:1:8:5.39752 +10000000:seq:1:8:61.2215 +10000000:seq:1:8:61.1856 +10000000:seq:1:8:61.2439 +10000000:seq:1:8:61.3168 +10000000:seq:1:8:61.2675 +10000000:seq:1:8:61.3151 +10000000:seq:1:8:61.2984 +10000000:seq:1:8:61.3882 +10000000:seq:1:8:61.2554 +10000000:seq:1:8:61.418 +10000000:seq:1:8:61.2247 +10000000:seq:1:8:61.4102 +10000000:seq:1:8:61.2489 +10000000:seq:1:8:61.4463 +10000000:seq:1:8:61.3078 +10000000:seq:1:8:61.3545 +10000000:seq:1:8:61.2355 +10000000:seq:1:8:61.3208 +10000000:seq:1:8:61.2932 +10000000:seq:1:8:61.269 diff --git a/results/rt/data_imgpro/rt_cores_gen_omp b/results/rt/data_imgpro/rt_cores_gen_omp new file mode 100644 index 0000000..212de34 --- /dev/null +++ b/results/rt/data_imgpro/rt_cores_gen_omp @@ -0,0 +1,200 @@ +gen_omp:1:45.7191 +gen_omp:1:45.6959 +gen_omp:1:45.6752 +gen_omp:1:45.6793 +gen_omp:1:45.6795 +gen_omp:1:45.6773 +gen_omp:1:45.672 +gen_omp:1:45.6786 +gen_omp:1:45.6742 +gen_omp:1:45.6799 +gen_omp:1:45.6813 +gen_omp:1:45.6769 +gen_omp:1:45.6741 +gen_omp:1:45.679 +gen_omp:1:45.6811 +gen_omp:1:45.6749 +gen_omp:1:45.6701 +gen_omp:1:45.6807 +gen_omp:1:45.6812 +gen_omp:1:45.6877 +gen_omp:2:45.834 +gen_omp:2:45.8319 +gen_omp:2:45.8229 +gen_omp:2:45.8048 +gen_omp:2:45.8445 +gen_omp:2:45.8248 +gen_omp:2:45.8165 +gen_omp:2:45.8064 +gen_omp:2:45.8413 +gen_omp:2:45.818 +gen_omp:2:45.8134 +gen_omp:2:45.826 +gen_omp:2:45.8498 +gen_omp:2:45.8302 +gen_omp:2:45.838 +gen_omp:2:45.8112 +gen_omp:2:45.8107 +gen_omp:2:45.8423 +gen_omp:2:45.825 +gen_omp:2:45.8178 +gen_omp:4:49.7237 +gen_omp:4:49.6649 +gen_omp:4:49.707 +gen_omp:4:49.6432 +gen_omp:4:49.6945 +gen_omp:4:49.6731 +gen_omp:4:49.6736 +gen_omp:4:49.7192 +gen_omp:4:49.6922 +gen_omp:4:49.6898 +gen_omp:4:49.7099 +gen_omp:4:49.6604 +gen_omp:4:49.6987 +gen_omp:4:49.6599 +gen_omp:4:49.7105 +gen_omp:4:49.6689 +gen_omp:4:49.7162 +gen_omp:4:49.6968 +gen_omp:4:49.6561 +gen_omp:4:49.6899 +gen_omp:6:51.344 +gen_omp:6:51.3546 +gen_omp:6:51.3075 +gen_omp:6:51.3245 +gen_omp:6:51.3647 +gen_omp:6:51.2735 +gen_omp:6:51.3357 +gen_omp:6:51.3185 +gen_omp:6:51.3452 +gen_omp:6:51.3548 +gen_omp:6:51.3291 +gen_omp:6:51.3285 +gen_omp:6:51.3395 +gen_omp:6:51.3995 +gen_omp:6:51.3232 +gen_omp:6:51.3169 +gen_omp:6:51.3638 +gen_omp:6:51.3748 +gen_omp:6:51.3446 +gen_omp:6:51.3544 +gen_omp:8:51.5259 +gen_omp:8:51.5661 +gen_omp:8:51.5456 +gen_omp:8:51.4913 +gen_omp:8:51.5367 +gen_omp:8:51.5368 +gen_omp:8:51.4301 +gen_omp:8:51.5036 +gen_omp:8:51.4914 +gen_omp:8:51.4864 +gen_omp:8:51.4273 +gen_omp:8:51.5363 +gen_omp:8:51.5027 +gen_omp:8:51.5599 +gen_omp:8:51.4953 +gen_omp:8:51.5596 +gen_omp:8:51.5016 +gen_omp:8:51.4668 +gen_omp:8:51.5571 +gen_omp:8:51.548 +gen_omp:10:51.7023 +gen_omp:10:51.4981 +gen_omp:10:51.7646 +gen_omp:10:51.5865 +gen_omp:10:51.7309 +gen_omp:10:51.6957 +gen_omp:10:51.6359 +gen_omp:10:51.7761 +gen_omp:10:51.493 +gen_omp:10:51.7321 +gen_omp:10:51.6379 +gen_omp:10:51.7234 +gen_omp:10:51.7454 +gen_omp:10:51.6149 +gen_omp:10:51.6594 +gen_omp:10:51.7029 +gen_omp:10:51.7179 +gen_omp:10:51.73 +gen_omp:10:51.7168 +gen_omp:10:51.722 +gen_omp:12:51.7948 +gen_omp:12:51.9958 +gen_omp:12:51.9133 +gen_omp:12:51.8933 +gen_omp:12:51.9436 +gen_omp:12:51.8421 +gen_omp:12:51.9344 +gen_omp:12:51.9036 +gen_omp:12:51.9861 +gen_omp:12:51.8511 +gen_omp:12:51.9035 +gen_omp:12:51.8874 +gen_omp:12:51.9267 +gen_omp:12:51.7872 +gen_omp:12:51.8772 +gen_omp:12:51.8572 +gen_omp:12:52.0143 +gen_omp:12:51.8624 +gen_omp:12:52.0192 +gen_omp:12:51.8121 +gen_omp:14:52.1369 +gen_omp:14:52.0997 +gen_omp:14:52.18 +gen_omp:14:52.097 +gen_omp:14:52.1741 +gen_omp:14:52.1045 +gen_omp:14:52.1886 +gen_omp:14:52.0797 +gen_omp:14:52.0978 +gen_omp:14:52.0415 +gen_omp:14:52.0505 +gen_omp:14:52.1786 +gen_omp:14:52.2193 +gen_omp:14:52.0602 +gen_omp:14:52.1051 +gen_omp:14:52.3598 +gen_omp:14:52.2135 +gen_omp:14:52.112 +gen_omp:14:52.1093 +gen_omp:14:52.0793 +gen_omp:16:52.4662 +gen_omp:16:52.3628 +gen_omp:16:52.3503 +gen_omp:16:52.4903 +gen_omp:16:52.3794 +gen_omp:16:52.3378 +gen_omp:16:52.2305 +gen_omp:16:52.5389 +gen_omp:16:52.4322 +gen_omp:16:52.5144 +gen_omp:16:52.4933 +gen_omp:16:52.4482 +gen_omp:16:52.2692 +gen_omp:16:52.5172 +gen_omp:16:52.6644 +gen_omp:16:52.4586 +gen_omp:16:52.352 +gen_omp:16:52.3946 +gen_omp:16:52.2738 +gen_omp:16:52.5329 +gen_omp:18:52.7264 +gen_omp:18:53.3835 +gen_omp:18:53.7212 +gen_omp:18:53.6607 +gen_omp:18:53.7224 +gen_omp:18:53.5878 +gen_omp:18:53.7494 +gen_omp:18:53.6663 +gen_omp:18:53.7335 +gen_omp:18:54.2608 +gen_omp:18:53.7146 +gen_omp:18:53.7848 +gen_omp:18:53.7176 +gen_omp:18:53.6559 +gen_omp:18:53.6612 +gen_omp:18:53.7376 +gen_omp:18:53.8391 +gen_omp:18:53.6373 +gen_omp:18:53.8065 +gen_omp:18:53.7587 diff --git a/results/rt/data_imgpro/rt_cores_gen_thread b/results/rt/data_imgpro/rt_cores_gen_thread new file mode 100644 index 0000000..76ff36b --- /dev/null +++ b/results/rt/data_imgpro/rt_cores_gen_thread @@ -0,0 +1,200 @@ +gen_thread:1:49.5797 +gen_thread:1:49.5308 +gen_thread:1:49.5523 +gen_thread:1:49.528 +gen_thread:1:49.5227 +gen_thread:1:49.5541 +gen_thread:1:49.5397 +gen_thread:1:49.5343 +gen_thread:1:49.5499 +gen_thread:1:49.5414 +gen_thread:1:49.5547 +gen_thread:1:49.5288 +gen_thread:1:49.564 +gen_thread:1:49.5373 +gen_thread:1:49.5274 +gen_thread:1:49.5364 +gen_thread:1:49.5346 +gen_thread:1:49.5285 +gen_thread:1:49.537 +gen_thread:1:49.5459 +gen_thread:2:47.6685 +gen_thread:2:47.6711 +gen_thread:2:47.6544 +gen_thread:2:47.6549 +gen_thread:2:47.668 +gen_thread:2:47.6542 +gen_thread:2:47.6636 +gen_thread:2:47.6641 +gen_thread:2:47.6745 +gen_thread:2:47.6777 +gen_thread:2:47.6857 +gen_thread:2:47.6642 +gen_thread:2:47.6757 +gen_thread:2:47.6794 +gen_thread:2:47.729 +gen_thread:2:47.6689 +gen_thread:2:47.6805 +gen_thread:2:47.6777 +gen_thread:2:47.6618 +gen_thread:2:47.6848 +gen_thread:4:50.65 +gen_thread:4:50.6324 +gen_thread:4:50.636 +gen_thread:4:50.6499 +gen_thread:4:50.6312 +gen_thread:4:50.6553 +gen_thread:4:50.6419 +gen_thread:4:50.6394 +gen_thread:4:50.6694 +gen_thread:4:50.6533 +gen_thread:4:50.644 +gen_thread:4:50.6464 +gen_thread:4:50.6441 +gen_thread:4:50.6424 +gen_thread:4:50.643 +gen_thread:4:50.6439 +gen_thread:4:50.6474 +gen_thread:4:50.6425 +gen_thread:4:50.6427 +gen_thread:4:50.6462 +gen_thread:6:51.9581 +gen_thread:6:51.9558 +gen_thread:6:51.966 +gen_thread:6:51.9587 +gen_thread:6:51.9449 +gen_thread:6:51.9615 +gen_thread:6:51.9592 +gen_thread:6:51.9544 +gen_thread:6:51.96 +gen_thread:6:51.9486 +gen_thread:6:51.953 +gen_thread:6:51.949 +gen_thread:6:51.9606 +gen_thread:6:51.9523 +gen_thread:6:51.9535 +gen_thread:6:51.9386 +gen_thread:6:51.9525 +gen_thread:6:51.9519 +gen_thread:6:51.9476 +gen_thread:6:51.9543 +gen_thread:8:52.0289 +gen_thread:8:52.0321 +gen_thread:8:52.008 +gen_thread:8:52.0204 +gen_thread:8:52.0033 +gen_thread:8:52.012 +gen_thread:8:52.0057 +gen_thread:8:52.0067 +gen_thread:8:52.037 +gen_thread:8:52.005 +gen_thread:8:52.0188 +gen_thread:8:52.0057 +gen_thread:8:52.0106 +gen_thread:8:52.0097 +gen_thread:8:52.0192 +gen_thread:8:52.0211 +gen_thread:8:52.0135 +gen_thread:8:51.9639 +gen_thread:8:52.0157 +gen_thread:8:52.015 +gen_thread:10:52.1073 +gen_thread:10:52.1174 +gen_thread:10:52.14 +gen_thread:10:52.1136 +gen_thread:10:52.1433 +gen_thread:10:52.1174 +gen_thread:10:52.0806 +gen_thread:10:52.1115 +gen_thread:10:52.1297 +gen_thread:10:52.1079 +gen_thread:10:52.1242 +gen_thread:10:52.1187 +gen_thread:10:52.1039 +gen_thread:10:52.1434 +gen_thread:10:52.1051 +gen_thread:10:52.1292 +gen_thread:10:52.1241 +gen_thread:10:52.1332 +gen_thread:10:52.1258 +gen_thread:10:52.1005 +gen_thread:12:52.2605 +gen_thread:12:52.2726 +gen_thread:12:52.2211 +gen_thread:12:52.2878 +gen_thread:12:52.2941 +gen_thread:12:52.283 +gen_thread:12:52.2518 +gen_thread:12:52.259 +gen_thread:12:52.2492 +gen_thread:12:52.2775 +gen_thread:12:52.2982 +gen_thread:12:52.2459 +gen_thread:12:52.2766 +gen_thread:12:52.181 +gen_thread:12:52.2297 +gen_thread:12:52.2869 +gen_thread:12:52.2167 +gen_thread:12:52.2796 +gen_thread:12:52.2584 +gen_thread:12:52.2922 +gen_thread:14:52.5473 +gen_thread:14:52.5256 +gen_thread:14:52.5335 +gen_thread:14:52.5245 +gen_thread:14:52.52 +gen_thread:14:52.4591 +gen_thread:14:52.4829 +gen_thread:14:52.4357 +gen_thread:14:52.4726 +gen_thread:14:52.5129 +gen_thread:14:52.4604 +gen_thread:14:52.5251 +gen_thread:14:52.4958 +gen_thread:14:52.5449 +gen_thread:14:52.5534 +gen_thread:14:52.5151 +gen_thread:14:52.4872 +gen_thread:14:52.4801 +gen_thread:14:52.4673 +gen_thread:14:52.4794 +gen_thread:16:52.7894 +gen_thread:16:52.783 +gen_thread:16:52.7788 +gen_thread:16:52.7692 +gen_thread:16:52.86 +gen_thread:16:52.7942 +gen_thread:16:52.751 +gen_thread:16:52.8877 +gen_thread:16:52.7587 +gen_thread:16:52.7398 +gen_thread:16:52.8216 +gen_thread:16:52.787 +gen_thread:16:52.7709 +gen_thread:16:52.6919 +gen_thread:16:52.7605 +gen_thread:16:52.7436 +gen_thread:16:52.745 +gen_thread:16:52.7906 +gen_thread:16:52.7986 +gen_thread:16:52.844 +gen_thread:18:53.0717 +gen_thread:18:53.0608 +gen_thread:18:53.0835 +gen_thread:18:53.2325 +gen_thread:18:53.4822 +gen_thread:18:53.4962 +gen_thread:18:53.4686 +gen_thread:18:53.5322 +gen_thread:18:53.5331 +gen_thread:18:53.5227 +gen_thread:18:53.5605 +gen_thread:18:53.5785 +gen_thread:18:53.5935 +gen_thread:18:53.581 +gen_thread:18:53.5893 +gen_thread:18:53.6062 +gen_thread:18:53.6778 +gen_thread:18:53.636 +gen_thread:18:53.6488 +gen_thread:18:53.6143 diff --git a/results/rt/data_imgpro/rt_cores_omp b/results/rt/data_imgpro/rt_cores_omp new file mode 100644 index 0000000..069888b --- /dev/null +++ b/results/rt/data_imgpro/rt_cores_omp @@ -0,0 +1,200 @@ +omp:1:45.7357 +omp:1:45.6883 +omp:1:45.6865 +omp:1:45.6844 +omp:1:45.6776 +omp:1:45.7003 +omp:1:45.681 +omp:1:45.6843 +omp:1:45.6906 +omp:1:45.6861 +omp:1:45.6837 +omp:1:45.6805 +omp:1:45.6875 +omp:1:45.6805 +omp:1:45.6846 +omp:1:45.6786 +omp:1:45.6734 +omp:1:45.6794 +omp:1:45.6837 +omp:1:45.7068 +omp:2:45.8326 +omp:2:45.8295 +omp:2:45.8087 +omp:2:45.8297 +omp:2:45.8169 +omp:2:45.8314 +omp:2:45.8006 +omp:2:45.8125 +omp:2:45.8167 +omp:2:45.8376 +omp:2:45.8056 +omp:2:45.8236 +omp:2:45.8261 +omp:2:45.8141 +omp:2:45.8343 +omp:2:45.8137 +omp:2:45.8459 +omp:2:45.8224 +omp:2:45.8344 +omp:2:45.8216 +omp:4:49.7087 +omp:4:49.6435 +omp:4:49.6838 +omp:4:49.6576 +omp:4:49.6977 +omp:4:49.6882 +omp:4:49.6872 +omp:4:49.7013 +omp:4:49.6612 +omp:4:49.7083 +omp:4:49.6807 +omp:4:49.7016 +omp:4:49.6912 +omp:4:49.697 +omp:4:49.6578 +omp:4:49.6815 +omp:4:49.6476 +omp:4:49.7094 +omp:4:49.7128 +omp:4:49.6767 +omp:6:51.3825 +omp:6:51.3752 +omp:6:51.349 +omp:6:51.3089 +omp:6:51.3242 +omp:6:51.3392 +omp:6:51.2991 +omp:6:51.3295 +omp:6:51.3093 +omp:6:51.3718 +omp:6:51.3472 +omp:6:51.2813 +omp:6:51.3272 +omp:6:51.3535 +omp:6:51.2488 +omp:6:51.3627 +omp:6:51.2711 +omp:6:51.3754 +omp:6:51.276 +omp:6:51.3427 +omp:8:51.5643 +omp:8:51.4862 +omp:8:51.5587 +omp:8:51.554 +omp:8:51.5317 +omp:8:51.4571 +omp:8:51.4816 +omp:8:51.5629 +omp:8:51.4244 +omp:8:51.5424 +omp:8:51.4998 +omp:8:51.529 +omp:8:51.5665 +omp:8:51.5768 +omp:8:51.5585 +omp:8:51.5341 +omp:8:51.4716 +omp:8:51.6132 +omp:8:51.4219 +omp:8:51.4883 +omp:10:51.7992 +omp:10:51.5919 +omp:10:51.7654 +omp:10:51.6212 +omp:10:51.6884 +omp:10:51.7546 +omp:10:51.7344 +omp:10:51.7494 +omp:10:51.6435 +omp:10:51.6505 +omp:10:51.6489 +omp:10:51.7358 +omp:10:51.7449 +omp:10:51.7101 +omp:10:51.6583 +omp:10:51.6155 +omp:10:51.4979 +omp:10:51.7856 +omp:10:51.6735 +omp:10:51.6534 +omp:12:51.9379 +omp:12:51.9491 +omp:12:51.9544 +omp:12:51.8284 +omp:12:51.9142 +omp:12:52.0903 +omp:12:51.8472 +omp:12:52.0148 +omp:12:51.9184 +omp:12:51.8539 +omp:12:51.8266 +omp:12:51.9485 +omp:12:51.8694 +omp:12:51.981 +omp:12:51.7983 +omp:12:51.9103 +omp:12:51.8441 +omp:12:51.9535 +omp:12:51.8935 +omp:12:52.0738 +omp:14:51.9736 +omp:14:52.2929 +omp:14:52.1712 +omp:14:52.1499 +omp:14:52.212 +omp:14:52.3327 +omp:14:52.1292 +omp:14:52.2435 +omp:14:52.0337 +omp:14:52.3092 +omp:14:52.1153 +omp:14:52.1584 +omp:14:52.1721 +omp:14:52.1981 +omp:14:52.0162 +omp:14:52.2888 +omp:14:52.0987 +omp:14:52.2448 +omp:14:52.146 +omp:14:52.1082 +omp:16:52.402 +omp:16:52.5233 +omp:16:52.5283 +omp:16:52.2721 +omp:16:52.5828 +omp:16:52.5883 +omp:16:52.421 +omp:16:52.2932 +omp:16:52.4741 +omp:16:52.339 +omp:16:52.3635 +omp:16:52.4886 +omp:16:52.3593 +omp:16:52.465 +omp:16:52.5404 +omp:16:52.5648 +omp:16:52.3201 +omp:16:52.1461 +omp:16:52.4488 +omp:16:52.3938 +omp:18:52.8147 +omp:18:52.8862 +omp:18:53.4763 +omp:18:53.6126 +omp:18:53.6759 +omp:18:53.541 +omp:18:53.5946 +omp:18:53.6125 +omp:18:53.5824 +omp:18:53.7207 +omp:18:53.6791 +omp:18:53.8307 +omp:18:53.8283 +omp:18:53.7807 +omp:18:53.6966 +omp:18:53.5535 +omp:18:53.6908 +omp:18:53.7789 +omp:18:53.6238 +omp:18:53.7812 diff --git a/results/rt/data_imgpro/rt_cores_seq b/results/rt/data_imgpro/rt_cores_seq new file mode 100644 index 0000000..5a2f36b --- /dev/null +++ b/results/rt/data_imgpro/rt_cores_seq @@ -0,0 +1,200 @@ +seq:1:45.4742 +seq:1:45.4225 +seq:1:45.4195 +seq:1:45.4216 +seq:1:45.42 +seq:1:45.4196 +seq:1:45.426 +seq:1:45.4135 +seq:1:45.4258 +seq:1:45.4193 +seq:1:45.4156 +seq:1:45.4226 +seq:1:45.4172 +seq:1:45.4238 +seq:1:45.4158 +seq:1:45.4216 +seq:1:45.4203 +seq:1:45.4208 +seq:1:45.4216 +seq:1:45.4178 +seq:2:45.4793 +seq:2:45.4258 +seq:2:45.4214 +seq:2:45.4125 +seq:2:45.4212 +seq:2:45.4153 +seq:2:45.443 +seq:2:45.4278 +seq:2:45.4299 +seq:2:45.4205 +seq:2:45.4274 +seq:2:45.4208 +seq:2:45.4216 +seq:2:45.4302 +seq:2:45.4209 +seq:2:45.5463 +seq:2:45.4325 +seq:2:45.4295 +seq:2:45.4262 +seq:2:45.4228 +seq:4:45.4309 +seq:4:45.4258 +seq:4:45.425 +seq:4:45.4234 +seq:4:45.4274 +seq:4:45.4217 +seq:4:45.4335 +seq:4:45.4267 +seq:4:45.4334 +seq:4:45.4196 +seq:4:45.426 +seq:4:45.4294 +seq:4:45.4277 +seq:4:45.4298 +seq:4:45.4295 +seq:4:45.422 +seq:4:45.4251 +seq:4:45.4257 +seq:4:45.4342 +seq:4:45.4285 +seq:6:45.4225 +seq:6:45.4193 +seq:6:45.418 +seq:6:45.4345 +seq:6:45.4276 +seq:6:45.4272 +seq:6:45.4262 +seq:6:45.4285 +seq:6:45.4253 +seq:6:45.4296 +seq:6:45.4286 +seq:6:45.4218 +seq:6:45.4262 +seq:6:45.4259 +seq:6:45.4263 +seq:6:45.446 +seq:6:45.424 +seq:6:45.4264 +seq:6:45.4292 +seq:6:45.4294 +seq:8:45.435 +seq:8:45.4504 +seq:8:45.4254 +seq:8:45.4279 +seq:8:45.4223 +seq:8:45.424 +seq:8:45.428 +seq:8:45.4206 +seq:8:45.4282 +seq:8:45.4356 +seq:8:45.42 +seq:8:45.4243 +seq:8:45.4298 +seq:8:45.4352 +seq:8:45.4304 +seq:8:45.4273 +seq:8:45.4316 +seq:8:45.4259 +seq:8:45.4211 +seq:8:45.4303 +seq:10:45.4363 +seq:10:45.4225 +seq:10:45.4244 +seq:10:45.4323 +seq:10:45.4329 +seq:10:45.4299 +seq:10:45.4263 +seq:10:45.4331 +seq:10:45.4263 +seq:10:45.4272 +seq:10:45.4225 +seq:10:45.4201 +seq:10:45.4251 +seq:10:45.4378 +seq:10:45.4333 +seq:10:45.4196 +seq:10:45.4234 +seq:10:45.4236 +seq:10:45.426 +seq:10:45.4211 +seq:12:45.4313 +seq:12:45.4336 +seq:12:45.4196 +seq:12:45.425 +seq:12:45.4235 +seq:12:45.42 +seq:12:45.4505 +seq:12:45.4289 +seq:12:45.4245 +seq:12:45.4262 +seq:12:45.4297 +seq:12:45.4315 +seq:12:45.4371 +seq:12:45.4204 +seq:12:45.4338 +seq:12:45.4207 +seq:12:45.4292 +seq:12:45.4297 +seq:12:45.4159 +seq:12:45.4204 +seq:14:45.4302 +seq:14:45.4241 +seq:14:45.4178 +seq:14:45.4302 +seq:14:45.4164 +seq:14:45.4266 +seq:14:45.4248 +seq:14:45.4289 +seq:14:45.4227 +seq:14:45.4299 +seq:14:45.422 +seq:14:45.4269 +seq:14:45.4302 +seq:14:45.4245 +seq:14:45.4466 +seq:14:45.4302 +seq:14:45.4283 +seq:14:45.4263 +seq:14:45.4233 +seq:14:45.4304 +seq:16:45.4481 +seq:16:45.4257 +seq:16:45.4252 +seq:16:45.4232 +seq:16:45.4319 +seq:16:45.4213 +seq:16:45.4281 +seq:16:45.429 +seq:16:45.4367 +seq:16:45.4273 +seq:16:45.4309 +seq:16:45.4315 +seq:16:45.4331 +seq:16:45.4255 +seq:16:45.4277 +seq:16:45.4274 +seq:16:45.4159 +seq:16:45.5484 +seq:16:45.4215 +seq:16:45.4299 +seq:18:45.4272 +seq:18:45.4338 +seq:18:45.4201 +seq:18:45.4289 +seq:18:45.4325 +seq:18:45.428 +seq:18:45.4202 +seq:18:45.425 +seq:18:45.4282 +seq:18:45.4238 +seq:18:45.4243 +seq:18:45.4393 +seq:18:45.4261 +seq:18:45.4241 +seq:18:45.4351 +seq:18:45.4195 +seq:18:45.3006 +seq:18:45.4752 +seq:18:45.4254 +seq:18:45.4123 diff --git a/rtbenchmarks/.gitignore b/rtbenchmarks/.gitignore new file mode 100644 index 0000000..f8aa0bc --- /dev/null +++ b/rtbenchmarks/.gitignore @@ -0,0 +1,2 @@ +data_basic/ +data_imgpro/ diff --git a/rtbenchmarks/plot_basic b/rtbenchmarks/plot_basic new file mode 100755 index 0000000..43fd512 --- /dev/null +++ b/rtbenchmarks/plot_basic @@ -0,0 +1,113 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +import os, sys +sys.path.append(os.path.abspath(os.path.dirname(os.path.abspath(__file__))+"/../scripts")) + +import fileinput +import numpy as np +import matplotlib as mpl + +show = len(sys.argv) > 1 and sys.argv[1] == 'show' +if not show: + mpl.use('pgf') + +import matplotlib.pyplot as plt +import matplotlib.lines as lines +from common import set_size, config_plt, get_colors, fix_log_rects + +config_plt() + + +def loadData(fn): + content = [] + + with open(fn) as f: + content = f.readlines() + + values = {} + for line in content: + n, method, sample, ncores, strtime = [x for x in line.split(':')] + time = float(strtime) + if method != "seq": + time = time/float(ncores) + if not n in values: + values[n] = [] + values[n].append(time); + + return values + + +def figSize(title, xlabel, xticks, output, datasrcs, error=False): + fig = plt.figure() + + plt.title(title) + plt.xlabel(xlabel) + plt.ylabel(u"temps (s)") + plt.xticks(xticks) + plt.xscale('log') + plt.yscale('log') + + nd = len(datasrcs) + + width = 3.5 + pos = .5-.5*nd + for f, label in datasrcs: + values = loadData(f) + barcolor, errcolor = get_colors(['seq', 'omp', 'gen_omp', 'gen_thread'], label) + + for k, a in values.items(): + x = int(k) + m = np.mean(a) + s = 2.5758 * np.std(a) / np.sqrt(len(a)) # confiance 99 % + + x = x * ((20+width)/(20-width))**pos + + p = np.log10(x) + lwidth = width * 10**(p-1) + + bar = plt.bar(x, m, width=lwidth, color=barcolor, label=label) + fix_log_rects(bar, 1e-4) + + if error: + plt.errorbar(x, m, s, elinewidth=1.5, capsize=2, ecolor=errcolor) + label='' + + pos = pos + 1 + + plt.legend(bbox_to_anchor=(.38, 1)) + + fig.set_size_inches(set_size(455.24408, .8)) + if not show: + plt.savefig(output, format='pdf', bbox_inches='tight') + return plt + + +# script +plts = [] + +plt = figSize(u"", u"taille des données", [1e2, 1e3, 1e4, 1e5, 1e6, 1e7], + "plots/rt_seq.pdf", [ + ['data_basic/rt_seq_seq', 'seq'], + ['data_basic/rt_seq_gen_omp', 'gen_omp'], + ['data_basic/rt_seq_gen_thread', 'gen_thread'], + ], + error=True + ) +plts.append(plt) + +for cores in [1, 2, 4, 6, 8, 10, 12, 14, 16, 18]: + plt = figSize(u"", u"taille des données", [1e2, 1e3, 1e4, 1e5, 1e6, 1e7], + "plots/rt_par_"+str(cores)+".pdf", [ + ['data_basic/rt_size_'+str(cores)+'_seq', 'seq'], + ['data_basic/rt_size_'+str(cores)+'_omp', 'omp'], + ['data_basic/rt_size_'+str(cores)+'_gen_omp', 'gen_omp'], + ['data_basic/rt_size_'+str(cores)+'_gen_thread', 'gen_thread'], + ], + error=True + ) + plts.append(plt) + +if show: + for plt in plts: + plt.show() diff --git a/rtbenchmarks/plot_imgpro b/rtbenchmarks/plot_imgpro new file mode 100755 index 0000000..7041573 --- /dev/null +++ b/rtbenchmarks/plot_imgpro @@ -0,0 +1,147 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +import os, sys +sys.path.append(os.path.abspath(os.path.dirname(os.path.abspath(__file__))+"/../scripts")) + +import fileinput +import numpy as np +import matplotlib as mpl + +show = len(sys.argv) > 1 and sys.argv[1] == 'show' +if not show: + mpl.use('pgf') + +import matplotlib.pyplot as plt +import matplotlib.lines as lines +from common import set_size, config_plt, get_colors + +config_plt() + + +def loadData(fn): + content = [] + + with open(fn) as f: + content = f.readlines() + + values = {} + for line in content: + method, ncores, strtime = [x for x in line.split(':')] + time = float(strtime) + if method != "seq": + time = time/float(ncores) + if not ncores in values: + values[ncores] = [] + values[ncores].append(time); + + return values + + +def figCores(title, xlabel, xticks, output, datasrcs, error=False): + fig = plt.figure() + + plt.title(title) + plt.xlabel(xlabel) + plt.ylabel(u"temps (s)") + plt.xticks(xticks) + + nd = len(datasrcs) + + width = .4 + pos = .5-.5*nd + for f, label in datasrcs: + values = loadData(f) + barcolor, errcolor = get_colors(['seq', 'omp', 'gen_omp', 'gen_thread'], label) + + if "1" in values: + values.pop("1") + + for k, a in values.items(): + x = int(k) + m = np.mean(a) + s = 2.5758 * np.std(a) / np.sqrt(len(a)) # confiance 99 % + + x = x + pos*width + + plt.bar(x, m, width=width, color=barcolor, label=label) + if error: + plt.errorbar(x, m, s, elinewidth=.8, capsize=1, ecolor=errcolor) + label='' + + pos = pos + 1 + + plt.legend(bbox_to_anchor=(1, 1)) + + fig.set_size_inches(set_size(455.24408, .8)) + if not show: + plt.savefig(output, format='pdf', bbox_inches='tight') + return plt + + +def figSpeedUp(title, xlabel, xticks, output, basetime, datasrcs): + fig = plt.figure() + + plt.title(title) + plt.xlabel(xlabel) + plt.ylabel(u"accélération") + plt.xticks(xticks) + + nd = len(datasrcs) + + width = .4 + pos = .5-.5*nd + for f, label in datasrcs: + values = loadData(f) + barcolor, errcolor = get_colors(['seq', 'omp', 'gen_omp', 'gen_thread'], label) + + if "1" in values: + values.pop("1") + + for k, a in values.items(): + x = int(k) + m = basetime/np.mean(a) + + x = x + pos*width + + plt.bar(x, m, width=width, color=barcolor, label=label) + label='' + + pos = pos + 1 + + plt.legend(bbox_to_anchor=(0.38, 1)) + + fig.set_size_inches(set_size(455.24408, .8)) + if not show: + plt.savefig(output, format='pdf', bbox_inches='tight') + return plt + + +# script +values = loadData('data_imgpro/rt_cores_seq') +basetime = np.mean(values["1"]) +plts = [] + +plt = figCores(u"", u"nombre de cÅ“urs", [2, 4, 6, 8, 10, 12, 14, 16, 18], + "plots/rt_cores.pdf", [ + # ['data_imgpro/rt_cores_seq', 'seq'], + ['data_imgpro/rt_cores_gen_omp', 'omp'], + ['data_imgpro/rt_cores_gen_omp', 'gen_omp'], + ['data_imgpro/rt_cores_gen_thread', 'gen_thread'], + ], + error=False + ) +plts.append(plt) + +plt = figSpeedUp(u"", u"nombre de cÅ“urs", [2, 4, 6, 8, 10, 12, 14, 16, 18], + "plots/rt_speedup.pdf", basetime, [ + ['data_imgpro/rt_cores_gen_omp', 'omp'], + ['data_imgpro/rt_cores_gen_omp', 'gen_omp'], + ['data_imgpro/rt_cores_gen_thread', 'gen_thread'], + ] + ) +plts.append(plt) + +if show: + for plt in plts: + plt.show() diff --git a/rtbenchmarks/run_rt_basic b/rtbenchmarks/run_rt_basic new file mode 100755 index 0000000..86a31aa --- /dev/null +++ b/rtbenchmarks/run_rt_basic @@ -0,0 +1,79 @@ +#!/bin/bash + +binary=./release/benchmarks/basic +preload="LD_PRELOAD=~bachelet/local/kephren/lib64/libstdc++.so.6" +repeat=20 + +outdir="rtbenchmarks/data_basic" + +[ -x "${binary}" ] || exit 1 + +run() { + coreset=$1 + size=$2 + method=$3 + sample=$4 + ncores=$5 + prefix="${size}:${method}:${sample}:${ncores}" + + for i in $(seq ${repeat}); do + t=$(eval "${preload} taskset -c ${coreset} ${binary} ${size} ${method} ${sample} ${ncores}"|cut -d' ' -f2) + echo "${prefix}:${t}" + done +} + +benchSeq() { + sizes=(100 1000 10000 100000 1000000 10000000) + + coreset=0 + sample=0 # seq + ncores=1 + + echo "---- benchSeq ----" + + for method in seq omp gen_omp gen_thread; do + echo "==== ${method}" + for size in ${sizes[@]}; do + run "${coreset}" "${size}" "${method}" "${sample}" "${ncores}" + done|tee "${outdir}/rt_seq_${method}" + done +} + +benchCores() { + cores=(1 2 4 6 8 10 12 14 16 18) + + size=10000000 + sample=1 # par + + echo "---- benchCores ----" + + for method in omp gen_omp gen_thread; do + echo "==== ${method}" + for ncores in ${cores[@]}; do + maxcore=$((ncores*4 - 1)) + coreset="$(seq -s, 0 4 ${maxcore})" + run "${coreset}" "${size}" "${method}" "${sample}" "${ncores}" + done|tee "${outdir}/rt_cores_${method}" + done +} + +benchSize() { + sizes=(100 1000 10000 100000 1000000 10000000) + ncores=$1 + + maxcore=$((ncores*4 - 1)) + coreset="$(seq -s, 0 4 ${maxcores})" + + sample=1 # par + + echo "---- benchSize (ncores: ${ncores}) ----" + + for method in seq omp gen_omp gen_thread; do + echo "==== ${method}" + for size in ${sizes[@]}; do + run "${coreset}" "${size}" "${method}" "${sample}" "${ncores}" + done|tee "${outdir}/rt_size_${ncores}_${method}" + done +} + +eval "$*" diff --git a/rtbenchmarks/run_rt_imgpro b/rtbenchmarks/run_rt_imgpro new file mode 100755 index 0000000..9497c7d --- /dev/null +++ b/rtbenchmarks/run_rt_imgpro @@ -0,0 +1,38 @@ +#!/bin/bash + +binary=./release/benchmarks/imgpro +preload="LD_PRELOAD=~bachelet/local/kephren/lib64/libstdc++.so.6" +repeat=20 + +outdir="rtbenchmarks/data_imgpro" + +[ -x "${binary}" ] || exit 1 + +run() { + coreset=$1 + method=$2 + ncores=$3 + prefix="${method}:${ncores}" + + for i in $(seq ${repeat}); do + t=$(eval "${preload} taskset -c ${coreset} ${binary} ${size} ${method} ${sample} ${ncores}"|cut -d' ' -f2) + echo "${prefix}:${t}" + done +} + +benchCores() { + cores=(1 2 4 6 8 10 12 14 16 18) + + echo "---- benchCores ----" + + for method in seq omp gen_omp gen_thread; do + echo "==== ${method}" + for ncores in ${cores[@]}; do + maxcore=$((ncores*4 - 1)) + coreset="$(seq -s, 0 4 ${maxcore})" + run "${coreset}" "${method}" "${ncores}" + done|tee "${outdir}/rt_cores_${method}" + done +} + +eval "$*" diff --git a/scripts/benchmark b/scripts/benchmark new file mode 100755 index 0000000..e04aba6 --- /dev/null +++ b/scripts/benchmark @@ -0,0 +1,102 @@ +#!/bin/bash + +binary=./release/benchmarks/basic + +[ -x "${binary}" ] || exit 1 + +#### Utilities +measure() { + coreset=$1 + size=$2 + method=$3 + sample=$4 + ncores=$5 + + t=$(eval "taskset -c ${coreset} ${binary} ${size} ${method} ${sample}"|cut -d' ' -f2) + echo "${t}" +} + +csv() { + echo "$*"|tr ' ' ',' +} + +## benchmarks + +#### No parallelism, sequential/generic, variable array sizes +bSeq() { + method=0 + sizes=(100 1000 10000 100000 1000000) + coreset=0 + cores=1 + + for size in ${sizes[@]}; do + ts_seq=($(measure "${coreset}" "${size}" seq $method $cores)) + ts_gen_omp=($(measure "${coreset}" "${size}" gen_omp $method $cores)) + ts_gen_thread=($(measure "${coreset}" "${size}" gen_thread $method $cores)) + + echo "$size ; $ts_seq ; $ts_gen_omp ; $ts_gen_thread" + done +} + +#### Fixed coreset, omp/generic, variable array sizes +bSizes() { + method=$1 + sizes=(100 1000 10000 100000 1000000) + coreset="0,4,8,12,16,20,24,28" + cores=8 + + for size in ${sizes[@]}; do + ts_seq=($(measure "${coreset}" "${size}" seq $method $cores)) + ts_omp=($(measure "${coreset}" "${size}" omp $method $cores)) + ts_gen_omp=($(measure "${coreset}" "${size}" gen_omp $method $cores)) + ts_gen_thread=($(measure "${coreset}" "${size}" gen_thread $method $cores)) + + ts_omp2=`bc <<< "scale=6; $ts_omp/$cores"` + ts_gen_omp2=`bc <<< "scale=6; $ts_gen_omp/$cores"` + ts_gen_thread2=`bc <<< "scale=6; $ts_gen_thread/$cores"` + + echo "$size ; $ts_seq ; $ts_omp ; $ts_omp2 ; $ts_gen_omp ; $ts_gen_omp2 ; $ts_gen_thread ; $ts_gen_thread2" + done +} + +#### Fixed array size, omp/generic, variable coresets +bCores() { + method=$1 + size=100000 + coresets=("0" "0,4" "0,4,8,12" "0,4,8,12,16,20" "0,4,8,12,16,20,24,28" "0,4,8,12,16,20,24,28,32,36" "0,4,8,12,16,20,24,28,32,36,40,44" "0,4,8,12,16,20,24,28,32,36,40,44,48,52" "0,4,8,12,16,20,24,28,32,36,40,44,48,52,56,60") + cores=1 + + for coreset in ${coresets[@]}; do + ts_seq=($(measure "${coreset}" "${size}" seq $method $cores)) + ts_omp=($(measure "${coreset}" "${size}" omp $method $cores)) + ts_gen_omp=($(measure "${coreset}" "${size}" gen_omp $method $cores)) + ts_gen_thread=($(measure "${coreset}" "${size}" gen_thread $method $cores)) + + ts_omp2=`bc <<< "scale=6; $ts_omp/$cores"` + ts_gen_omp2=`bc <<< "scale=6; $ts_gen_omp/$cores"` + ts_gen_thread2=`bc <<< "scale=6; $ts_gen_thread/$cores"` + + echo "$cores ; $ts_seq ; $ts_omp ; $ts_omp2 ; $ts_gen_omp ; $ts_gen_omp2 ; $ts_gen_thread ; $ts_gen_thread2" + + if [ $cores == 1 ]; then + cores=2 + else + cores=$[cores+2] + fi + done +} + +bCores 1 | tee ./scripts/result_cores_1.csv +./scripts/result_cores_1.plot + +bCores 2 | tee scripts/result_cores_2.csv +./scripts/result_cores_2.plot + +bSizes 1 | tee scripts/result_sizes_1.csv +./scripts/result_sizes_1.plot + +bSizes 2 | tee scripts/result_sizes_2.csv +./scripts/result_sizes_2.plot + +bSeq | tee scripts/result_seq.csv +./scripts/result_seq.plot diff --git a/scripts/common.py b/scripts/common.py new file mode 100644 index 0000000..f5dac04 --- /dev/null +++ b/scripts/common.py @@ -0,0 +1,59 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +import matplotlib.pyplot as plt +import matplotlib.lines as lines + +def set_size(width, fraction=1): + """ Set aesthetic figure dimensions to avoid scaling in latex. + + Parameters + ---------- + width: float + Width in pts (\\the\\textwidth) + fraction: float + Fraction of the width which you wish the figure to occupy + + Returns + ------- + fig_dim: tuple + Dimensions of figure in inches + """ + # Width of figure + fig_width_pt = width * fraction + + # Convert from pt to inches + inches_per_pt = 1 / 72.27 + + # Golden ratio to set aesthetic figure height + golden_ratio = (5 ** 0.5 - 1) / 2 + + # Figure width in inches + fig_width_in = fig_width_pt * inches_per_pt + # Figure height in inches + fig_height_in = fig_width_in * golden_ratio + + return fig_width_in, fig_height_in + + +def config_plt(): + plt.rc('font', size=11, family='Latin Modern Roman') + plt.rc('text', usetex=True) + plt.rc('xtick', labelsize=11) + plt.rc('ytick', labelsize=11) + plt.rc('axes', labelsize=11) + + +def get_colors(l, v): + color_palette = [ + '#1f77b4', '#ff7f0e', '#2ca02c', '#d62728', '#9467bd', + '#8c564b', '#e377c2', '#7f7f7f', '#bcbd22', '#17becf', + ] + return color_palette[l.index(v)], '#888888' + + +def fix_log_rects(bar, e = 1e-4): + for rect in bar.patches: + if rect.get_y() == 0: + rect.set_y(e) + rect.set_height(rect.get_height() - e) diff --git a/scripts/red_expr b/scripts/red_expr new file mode 100755 index 0000000..91b8846 --- /dev/null +++ b/scripts/red_expr @@ -0,0 +1,14 @@ +#!/bin/bash + +cat|sed -r \ + -e 's/.*Ts = \{[A-Za-z0-9_]+<(.*)>\};.*/\1/g' \ + -e 's/Expression/E/g' \ + -e 's/op::Comma/#/g' \ + -e 's/op::Assign/=/g' \ + -e 's/op::Addition/+/g' \ + -e 's/op::Multiplication/*/g' \ + -e 's/IntToType<(.)ul>/\1/g' \ + -e 's/IteratorImpl<>/IT/g' \ + -e 's/IteratorImpl<(.) >/\1/g' \ + -e 's/int\*, //g' \ + -e 's/, IteratorImpl<> //g' diff --git a/scripts/result_cores_1.plot b/scripts/result_cores_1.plot new file mode 100755 index 0000000..30ccdd3 --- /dev/null +++ b/scripts/result_cores_1.plot @@ -0,0 +1,24 @@ +#!/usr/bin/gnuplot + +set encoding iso_8859_1 +set terminal postscript eps enhanced +set notitle +set xlabel "Number of Cores" +set ylabel "Execution Time" +set output "./scripts/result_cores_1.eps" + +set key top left +set style line 1 lt 1 lw 3 +set style line 2 lt 7 lw 3 +set style line 3 lt 2 lw 3 +set style line 4 lt 1 lw 1 +set style line 5 lt 5 lw 3 +set style function lines + +plot './scripts/result_cores_1.csv' using 1:3 with lines linestyle 1 title "sequential", \ + './scripts/result_cores_1.csv' using 1:7 with lines linestyle 2 title "openmp", \ + './scripts/result_cores_1.csv' using 1:11 with lines linestyle 3 title "tmp+openmp", \ + './scripts/result_cores_1.csv' using 1:15 with lines linestyle 4 title "tmp+thread" + +quit + diff --git a/scripts/result_cores_2.plot b/scripts/result_cores_2.plot new file mode 100755 index 0000000..be2c17a --- /dev/null +++ b/scripts/result_cores_2.plot @@ -0,0 +1,25 @@ +#!/usr/bin/gnuplot + +set encoding iso_8859_1 +set terminal postscript eps enhanced +set notitle +set xlabel "Number of Cores" +set ylabel "Execution Time" +set output "./scripts/result_cores_2.eps" + +set key top left +set style line 1 lt 1 lw 3 +set style line 2 lt 7 lw 3 +set style line 3 lt 2 lw 3 +set style line 4 lt 1 lw 1 +set style line 5 lt 5 lw 3 +set style function lines + +plot './scripts/result_cores_2.csv' using 1:3 with lines linestyle 1 title "sequential", \ + './scripts/result_cores_2.csv' using 1:7 with lines linestyle 2 title "openmp", \ + './scripts/result_cores_2.csv' using 1:11 with lines linestyle 3 title "tmp+openmp", \ + './scripts/result_cores_2.csv' using 1:15 with lines linestyle 4 title "tmp+thread" + + +quit + diff --git a/scripts/result_seq.plot b/scripts/result_seq.plot new file mode 100755 index 0000000..c50eb9f --- /dev/null +++ b/scripts/result_seq.plot @@ -0,0 +1,25 @@ +#!/usr/bin/gnuplot + +set encoding iso_8859_1 +set terminal postscript eps enhanced +set notitle +set xlabel "Array Size (log_{10})" +set ylabel "Execution Time (log_{10})" +set output "./scripts/result_seq.eps" + +set key top left +set style line 1 lt 1 lw 3 +set style line 2 lt 7 lw 3 +set style line 3 lt 2 lw 3 +set style line 4 lt 1 lw 1 +set style line 5 lt 5 lw 3 +set style function lines + +set logscale xy 10 + +plot './scripts/result_seq.csv' using 1:3 with lines linestyle 1 title "sequential", \ + './scripts/result_seq.csv' using 1:5 with lines linestyle 3 title "tmp+openmp", \ + './scripts/result_seq.csv' using 1:7 with lines linestyle 4 title "tmp+thread" + +quit + diff --git a/scripts/result_sizes_1.plot b/scripts/result_sizes_1.plot new file mode 100755 index 0000000..69427bd --- /dev/null +++ b/scripts/result_sizes_1.plot @@ -0,0 +1,26 @@ +#!/usr/bin/gnuplot + +set encoding iso_8859_1 +set terminal postscript eps enhanced +set notitle +set xlabel "Array Size (log_{10})" +set ylabel "Execution Time (log_{10})" +set output "./scripts/result_sizes_1.eps" + +set key top left +set style line 1 lt 1 lw 3 +set style line 2 lt 7 lw 3 +set style line 3 lt 2 lw 3 +set style line 4 lt 1 lw 1 +set style line 5 lt 5 lw 3 +set style function lines + +set logscale xy 10 + +plot './scripts/result_sizes_1.csv' using 1:3 with lines linestyle 1 title "sequential", \ + './scripts/result_sizes_1.csv' using 1:7 with lines linestyle 2 title "openmp", \ + './scripts/result_sizes_1.csv' using 1:11 with lines linestyle 3 title "tmp+openmp", \ + './scripts/result_sizes_1.csv' using 1:15 with lines linestyle 4 title "tmp+thread" + +quit + diff --git a/scripts/result_sizes_2.plot b/scripts/result_sizes_2.plot new file mode 100755 index 0000000..5cdab3b --- /dev/null +++ b/scripts/result_sizes_2.plot @@ -0,0 +1,27 @@ +#!/usr/bin/gnuplot + +set encoding iso_8859_1 +set terminal postscript eps enhanced +set notitle +set xlabel "Array Size (log_{10})" +set ylabel "Execution Time (log_{10})" +set output "./scripts/result_sizes_2.eps" + +set key top left +set style line 1 lt 1 lw 3 +set style line 2 lt 7 lw 3 +set style line 3 lt 2 lw 3 +set style line 4 lt 1 lw 1 +set style line 5 lt 5 lw 3 +set style function lines + +set logscale xy 10 + +plot './scripts/result_sizes_2.csv' using 1:3 with lines linestyle 1 title "sequential", \ + './scripts/result_sizes_2.csv' using 1:7 with lines linestyle 2 title "openmp", \ + './scripts/result_sizes_2.csv' using 1:11 with lines linestyle 3 title "tmp+openmp", \ + './scripts/result_sizes_2.csv' using 1:15 with lines linestyle 4 title "tmp+thread" + + +quit + diff --git a/src/pfor/algorithm.h b/src/pfor/algorithm.h new file mode 100644 index 0000000..157f6a6 --- /dev/null +++ b/src/pfor/algorithm.h @@ -0,0 +1,59 @@ +#ifndef PFOR_PFOR_ALGORITHM_H +#define PFOR_PFOR_ALGORITHM_H + +#include "index/properties.h" +#include "expression/expression.h" + +namespace pfor { + +/** + */ +template +struct SubstituteVariableInLinIndexSlopeImpl { + using type = I; +}; + +template +struct SubstituteVariableInLinIndexSlopeImpl>> { + using type = index::LinearIndex, index::linearSlope*b + index::linearOffset>; +}; + +template +using SubstituteVariableInLinIndexSlope = typename SubstituteVariableInLinIndexSlopeImpl::type; + +/** + */ +template struct SubstituteVariableInExpressionImpl; + +template +struct SubstituteVariableInExpressionImpl, a, b> { + using type = expr::Expression::type...>; +}; + +template +struct SubstituteVariableInExpressionImpl, a, b> { + using type = expr::Expression>; +}; + +template +struct SubstituteVariableInExpressionImpl, Id, Index>, a, b> { + using type = expr::Expression, Id, SubstituteVariableInLinIndexSlope>; +}; + +template +struct SubstituteVariableInExpressionImpl, a, b> { + using type = expr::Constant; +}; + +template +using SubstituteVariableInExpression = typename SubstituteVariableInExpressionImpl::type; + +template +struct GenSubstituteVariableInExpression { + template + using type = SubstituteVariableInExpression; +}; + +} + +#endif diff --git a/src/pfor/clusters.h b/src/pfor/clusters.h new file mode 100644 index 0000000..2083dce --- /dev/null +++ b/src/pfor/clusters.h @@ -0,0 +1,143 @@ +#ifndef PFOR_PFOR_CLUSTERS_H +#define PFOR_PFOR_CLUSTERS_H + +#include "comparators.h" +#include "conditions.h" +#include "expression/algorithm.h" +#include "expression/tuple.h" +#include "expression/info.h" +#include "expression/subexpression.h" +#include "mp/pack.h" +#include "mp/tuple.h" +#include "parallelizable.h" + +namespace pfor { + +/** + */ +template struct ClusterExpressionIdsImpl; + +template +struct ClusterExpressionIdsImpl, Ts...>> { + using type = PackPrepend>::type, I>; +}; + +template<> +struct ClusterExpressionIdsImpl> { + using type = Pack<>; +}; + +template +using ClusterExpressionIds = typename ClusterExpressionIdsImpl::type; + +/** + */ +template struct ClustersExpressionIdsImpl; + +template +struct ClustersExpressionIdsImpl> { + using type = PackPrepend>::type, ClusterExpressionIds>; +}; + +template<> +struct ClustersExpressionIdsImpl> { + using type = Pack<>; +}; + +template +using ClustersExpressionIds = typename ClustersExpressionIdsImpl::type; + +/** + */ +template> struct ClustersInsertImpl; + +template +struct ClustersInsertImpl, E, IndependantClusters, CurrentCluster> { + static constexpr bool depends = clusterDepends; + using next_clusters = Pack; + using tmp_independant_clusters = PackRemove; + using new_independant_clusters = If; + using tmp_current_cluster = PackSort>; + using new_current_cluster = If; + using type = typename ClustersInsertImpl::type; +}; + +template +struct ClustersInsertImpl, E, IndependantClusters, CurrentCluster> { + using type = PackAppend; +}; + +template +using ClustersInsert = typename ClustersInsertImpl::type; + +/** + */ +namespace impl { + +template struct ClustersGenImpl; + +template +struct ClustersGenImpl> { + using tmp_out = ClustersInsert; + using type = typename ClustersGenImpl>::type; +}; + +template +struct ClustersGenImpl> { + using type = Clusters; +}; + +template +using ClustersGen = typename ClustersGenImpl, ExprInfo>::type; + +} + +template +struct ClustersGen { + using comma_splitted_expr = expr::SplitComma; + using expr_info = expr::ExpressionInfo; + using clusters = impl::ClustersGen; + using clusters_ids = ClustersExpressionIds; + using type = PackSort; +}; + +/** + */ +template struct FilterClustersImpl; + +template +struct FilterClustersImpl> { + using expr_type = expr::ExpressionsTuple; + using tuple_type = SubTuple; + using subexpr_type = expr::SubExpression; + + using merge_cluster = If, Cluster, Pack<>>; + using next = typename FilterClustersImpl>::type; + using type = PackMerge; +}; + +template +struct FilterClustersImpl> { + using type = Pack<>; +}; + +template +using FilterClusters = typename FilterClustersImpl::type; + +/** + */ +template +using SequentialCluster = typename FilterClustersImpl::type; + +/** + */ +template +using ParallelCluster = typename FilterClustersImpl::type; + +/** + */ +template struct ExpressionFromClusters; + +} + +#endif diff --git a/src/pfor/comparators.h b/src/pfor/comparators.h new file mode 100644 index 0000000..4f24280 --- /dev/null +++ b/src/pfor/comparators.h @@ -0,0 +1,98 @@ +#ifndef PFOR_PFOR_COMPARATORS_H +#define PFOR_PFOR_COMPARATORS_H + +#include "mp/meta.h" +#include "mp/pack.h" + +namespace pfor { + +/** + * @brief compares two unsigned integers boxed in a type + * + * @param Lhs a boxed unsigned integer + * @param Rhs a boxed unsigned integer + * + * @return Lhs < Rhs + */ +template struct ComparatorUIntToType; + +template +struct ComparatorUIntToType, UIntToType> { + static constexpr bool value = lhs < rhs; +}; + +template +constexpr bool comparatorUIntToType = ComparatorUIntToType::value; + +/** + * @brief compares two packs of boxed unsigned integers + * + * @param Lhs a pack of boxed unsigned integer + * @param Rhs a pack of boxed unsigned integer + * + * @return Lhs < Rhs + */ +template struct ComparatorUIntPack; + +template +struct ComparatorUIntPack, As...>, Pack, Bs...>> { + static constexpr bool value = a == b? ComparatorUIntPack, Pack>::value:(a < b); +}; + +template +struct ComparatorUIntPack, Pack...>> { + static constexpr bool value = true; +}; + +template +struct ComparatorUIntPack...>, Pack<>> { + static constexpr bool value = false; +}; + +template<> +struct ComparatorUIntPack, Pack<>> { + static constexpr bool value = false; +}; + +template +constexpr bool comparatorUIntPack = ComparatorUIntPack::value; + +/** + * @brief compares two expression's information (boxed integer, W, R) + * + * @param Lhs an expression's information + * @param Rhs an expression's information + * + * @return Lhs < Rhs (using the boxed integer) + */ +template struct ComparatorExpressionInfo; + +template +struct ComparatorExpressionInfo, W1, R1>, Pack, W2, R2>> { + static constexpr bool value = i1 < i2; +}; + +template +constexpr bool comparatorExpressionInfo = ComparatorExpressionInfo::value; + +/** + * @brief compares two written variables sets + * + * @param Lhs an expression's information + * @param Rhs an expression's information + * + * @return Lhs < Rhs (using the W pack) + */ +template struct ComparatorWritePack; + +template +struct ComparatorWritePack, Pack> { + static constexpr bool value = comparatorUIntPack; +}; + +template +constexpr bool comparatorWritePack = ComparatorWritePack::value; + +} + +#endif diff --git a/src/pfor/conditions.h b/src/pfor/conditions.h new file mode 100644 index 0000000..28c502b --- /dev/null +++ b/src/pfor/conditions.h @@ -0,0 +1,56 @@ +#ifndef PFOR_PFOR_CONDITIONS_H +#define PFOR_PFOR_CONDITIONS_H + +#include "mp/pack.h" + +namespace pfor { + +/** + * @brief testing Bernstein's conditions on two expressions + * + * @param E0 an expression's information (I, W, R) where W and R are sets of written/read variables + * @param E1 an expression's information + * + * @return true if the expressions depend on each other + * + * Bernstein's conditions for independance are : + * - no intersection between modified variables (xW, yW) + * - no intersection between read/modified variables (xR, yW) and (yR, xW) + */ +template struct ExpressionDepends; + +template +struct ExpressionDepends, Pack> { + static constexpr bool value = PackIntersects::value || PackIntersects::value || PackIntersects::value; +}; + +template +constexpr bool expressionDepends = ExpressionDepends::value; + +/** + * @brief testing Bernstein's conditions between each expression of a pack with one expression + * + * @param C a cluster of expressions' information + * @param T an expression's information + * + * @return true if any of the expressions from the cluster depends on the expression T + */ +template struct ClusterDepends; + +template +struct ClusterDepends, T> { + using next = ClusterDepends, T>; + static constexpr bool value = ExpressionDepends::value || next::value; +}; + +template +struct ClusterDepends, T> { + static constexpr bool value = false; +}; + +template +constexpr bool clusterDepends = ClusterDepends::value; + +} + +#endif diff --git a/src/pfor/expression/access.h b/src/pfor/expression/access.h new file mode 100644 index 0000000..dfb3754 --- /dev/null +++ b/src/pfor/expression/access.h @@ -0,0 +1,15 @@ +#ifndef PFOR_PFOR_EXPRESSION_ACCESS_H +#define PFOR_PFOR_EXPRESSION_ACCESS_H + +namespace pfor { +namespace expr { + +/** + * Access type + */ +enum class Access { write, read }; + +} +} + +#endif diff --git a/src/pfor/expression/algorithm.h b/src/pfor/expression/algorithm.h new file mode 100644 index 0000000..03491ea --- /dev/null +++ b/src/pfor/expression/algorithm.h @@ -0,0 +1,163 @@ +#ifndef PFOR_PFOR_EXPRESSION_ALGORITHM_H +#define PFOR_PFOR_EXPRESSION_ALGORITHM_H + +#include "access.h" +#include "expression.h" +#include "operandtag.h" +#include "../mp/pack.h" +#include "../mp/meta.h" + +namespace pfor { +namespace expr { + +/** + * @brief returns a pack of sub expressions + */ +template struct SplitCommaImpl; + +template +struct SplitCommaImpl> { + using type = Pack; +}; + +template +struct SplitCommaImpl> { + using type = Pack>; +}; + +template +using SplitComma = typename SplitCommaImpl::type; + +/** + * @brief returns a comma separated expression from pack + */ +template struct MergeCommaImpl; + +template +struct MergeCommaImpl> { + using type = Expression; +}; + +template +struct MergeCommaImpl> { + using type = T; +}; + +template +using MergeComma = typename MergeCommaImpl

::type; + +/** + * @brief returns the worst access (write being worse than read) + */ +template struct WorstAccess; + +template +struct WorstAccess { + static constexpr Access value = (access == Access::write? Access::write:WorstAccess::value); +}; + +template +struct WorstAccess { + static constexpr Access value = access; +}; + +/** + */ +template struct IncludeTagsImpl; + +template +struct IncludeTagsImpl, Ts...>> { + using trail = typename IncludeTagsImpl>::type; + using trailit = typename IncludeTagsImpl>::indices; + using type = pfor::If{}, PackPrepend>, trail>; + using indices = pfor::If{}, PackPrepend, trailit>; +}; + +template +struct IncludeTagsImpl> { + using type = Pack<>; + using indices = Pack<>; +}; + +template +using IncludeTags = typename IncludeTagsImpl::type; + +/** + */ +template struct ExcludeTagsImpl; + +template +struct ExcludeTagsImpl, Ts...>> { + using trail = typename ExcludeTagsImpl>::type; + using type = pfor::If{}, PackPrepend>, trail>; +}; + +template +struct ExcludeTagsImpl> { + using type = Pack<>; +}; + +template +using ExcludeTags = typename ExcludeTagsImpl::type; + +/** + */ +template struct CountWrite; + +template +struct CountWrite, Ts...>> { + static constexpr std::size_t value = (access == Access::write? 1:0) + CountWrite>::value; +}; + +template<> +struct CountWrite> { + static constexpr std::size_t value = 0; +}; + +template +constexpr std::size_t countWrite = CountWrite

::value; + +/** + */ +template struct FilterOperandTagsImpl; + +template +struct FilterOperandTagsImpl, Ts...>, accessReq> { + using trail = typename FilterOperandTagsImpl, accessReq>::type; + using type = pfor::If>, trail>; +}; + +template +struct FilterOperandTagsImpl, Ts...>, accessReq> { + using type = typename FilterOperandTagsImpl, accessReq>::type; +}; + +template +struct FilterOperandTagsImpl, access> { + using type = Pack<>; +}; + +template +using FilterOperandTags = typename FilterOperandTagsImpl::type; + +/** + */ +template struct IndicesFromOperandTagsImpl; + +template +struct IndicesFromOperandTagsImpl, Ts...>> { + using type = PackPrepend>::type, Index>; +}; + +template<> +struct IndicesFromOperandTagsImpl> { + using type = Pack<>; +}; + +template +using IndicesFromOperandTags = typename IndicesFromOperandTagsImpl

::type; + +} +} + +#endif diff --git a/src/pfor/expression/asexpression.h b/src/pfor/expression/asexpression.h new file mode 100644 index 0000000..e739c47 --- /dev/null +++ b/src/pfor/expression/asexpression.h @@ -0,0 +1,36 @@ +#ifndef PFOR_PFOR_EXPRESSION_ASEXPRESSION_H +#define PFOR_PFOR_EXPRESSION_ASEXPRESSION_H + +#include "expression.h" + +namespace pfor { +namespace expr { + +/** + * @brief turn into Expression if not already one + */ +template struct AsExpressionImpl; + +template +struct AsExpressionImpl>> { + using type = T; +}; + +template +struct AsExpressionImpl>> { + using type = Constant; +}; + +template +using AsExpression = typename AsExpressionImpl::type; + +} + +template +expr::AsExpression> xpr(T&& v) { + return {std::forward(v)}; +} + +} + +#endif diff --git a/src/pfor/expression/expression.h b/src/pfor/expression/expression.h new file mode 100644 index 0000000..9506551 --- /dev/null +++ b/src/pfor/expression/expression.h @@ -0,0 +1,241 @@ +#ifndef PFOR_PFOR_EXPRESSION_EXPRESSION_H +#define PFOR_PFOR_EXPRESSION_EXPRESSION_H + +#include + +#include "op.h" +#include "tag.h" +#include "../index/index.h" +#include "../index/traits.h" +#include "../tuple_view.h" + +namespace pfor { +namespace expr { + +struct IgnoredId; + +template struct Expression; +template struct Constant; + +template +struct Constant { + using IsExpression = tag::Expression; + using DataType = T; + using Id = IgnoredId; + using ThisType = Constant; + + DataType data; + + Constant() = delete; + Constant(DataType const& data): data{data} {} + Constant(ThisType const& e): data{e.data} {} + + inline DataType const& eval() { return data; } + inline DataType const& operator[](index::Value) const { return data; } + + template>* = nullptr> + inline ThisType& operator[](Index const&) { return *this; } +}; + +template +struct Constant { + using IsExpression = tag::Expression; + using DataType = T const*; + using Id = IgnoredId; + using ThisType = Constant; + + DataType data; + + Constant() = delete; + Constant(DataType const& data): data{data} {} + Constant(ThisType const& e): data{e.data} {} + + inline T const& operator[](index::Value i) const { return data[i]; } + + template>* = nullptr> + inline ThisType& operator[](Index const&) { return *this; } +}; + +template +struct Constant> { + using IsExpression = tag::Expression; + using DataType = index::Value; + using Id = IgnoredId; + using ThisType = Constant; + using Index = index::IndexImpl; + + Constant() = delete; + Constant(Index) {} + Constant(ThisType const&) {} + + inline DataType operator[](index::Value i) const { return Index::eval(i); } +}; + +template +struct Expression { + using IsExpression = tag::Expression; + using DataType = T*; + using Index = Index_; + using ThisType = Expression; + + DataType data; + + Expression() = delete; + Expression(DataType data): data{data} {} + + inline auto& operator[](index::Value i) { return data[Index::eval(i)]; } + + template>* = nullptr> + inline auto operator[](NIndex const&) { return Expression{data}; } + + inline auto begin() { return std::begin(data); } + inline auto end() { return std::end(data); } + + // inline auto operator=(ThisType const& rhs) { + // return Expression{{}, *this, rhs}; + // } + + template>* = nullptr> + inline auto operator=(Rhs rhs) { + return Expression{{}, *this, rhs}; + } + + template>* = nullptr> + inline auto operator=(Rhs rhs) { + return Expression>{{}, *this, rhs}; + } + + inline auto operator++(int) { return Expression{{}, *this}; } + inline auto operator--(int) { return Expression{{}, *this}; } + inline auto operator++() { return Expression{{}, *this}; } + inline auto operator--() { return Expression{{}, *this}; } +}; + +template +struct Expression, Id, Index_> { + using IsExpression = tag::Expression; + using DataTypeRaw = std::array; + using DataType = DataTypeRaw&; + using Index = Index_; + using ThisType = Expression; + + DataType data; + + Expression() = delete; + Expression(DataType data): data{data} {} + + inline auto& operator[](index::Value i) { return data[Index::eval(i)]; } + + template>* = nullptr> + inline auto operator[](NIndex const&) { return Expression{data}; } + + inline auto begin() { return std::begin(data); } + inline auto end() { return std::end(data); } + + // inline auto operator=(ThisType const& rhs) { + // return Expression{{}, *this, rhs}; + // } + + template>* = nullptr> + inline auto operator=(Rhs rhs) { + return Expression{{}, *this, rhs}; + } + + template>* = nullptr> + inline auto operator=(Rhs rhs) { + return Expression>{{}, *this, rhs}; + } + + inline auto operator++(int) { return Expression{{}, *this}; } + inline auto operator--(int) { return Expression{{}, *this}; } + inline auto operator++() { return Expression{{}, *this}; } + inline auto operator--() { return Expression{{}, *this}; } +}; + +template +struct Expression { + using IsExpression = tag::Expression; + using ThisType = Expression; + + static constexpr std::size_t arity = sizeof...(ETs); + + using AritySequence = decltype(std::make_index_sequence()); + + Op op; + std::tuple operands; + + Expression() = delete; + Expression(Op const& op, ETs const&... e): op(op), operands{e...} {} + Expression(ThisType const& e): op(e.op), operands{e.operands} {} + Expression(ThisType&& e): op(std::move(e.op)), operands{std::move(e.operands)} {} + + inline decltype(auto) eval() { return eval(AritySequence{}); } + inline decltype(auto) operator[](index::Value i) { return eval(i, AritySequence{}); } + + // inline auto operator=(ThisType const& rhs) { + // return Expression{{}, *this, rhs}; + // } + + template>* = nullptr> + inline auto operator=(Rhs rhs) { + return Expression{{}, *this, rhs}; + } + + template>* = nullptr> + inline auto operator=(Rhs rhs) { + return Expression>{{}, *this, rhs}; + } + + template + inline decltype(auto) eval(std::index_sequence) { + return op.eval(std::get(operands)...); + } + + template + inline decltype(auto) eval(index::Value i, std::index_sequence) { + return op.eval(i, std::get(operands)...); + } + + inline auto operator++(int) { return Expression{{}, *this}; } + inline auto operator--(int) { return Expression{{}, *this}; } + inline auto operator++() { return Expression{{}, *this}; } + inline auto operator--() { return Expression{{}, *this}; } +}; + +template +struct Expression, View, ETs...> { + using IsExpression = tag::Expression; + using ThisType = Expression; + using Tuple = std::tuple; + using RefExpression = Expression; + + static constexpr std::size_t arity = packSize; + + using AritySequence = decltype(std::make_index_sequence()); + + Op op; + TupleView operands; + + Expression() = delete; + Expression(RefExpression& e): op(e.op), operands{e.operands} {} + Expression(ThisType const& e): op(e.op), operands{e.operands} {} + Expression(ThisType&& e): op(std::move(e.op)), operands{std::move(e.operands)} {} + + inline decltype(auto) eval() { return eval(AritySequence{}); } + inline decltype(auto) operator[](index::Value i) { return eval(i, AritySequence{}); } + + template + inline decltype(auto) eval(std::index_sequence) { + return op.eval(std::get(operands)...); + } + + template + inline decltype(auto) eval(index::Value i, std::index_sequence) { + return op.eval(i, std::get(operands)...); + } +}; + +} +} + +#endif diff --git a/src/pfor/expression/info.h b/src/pfor/expression/info.h new file mode 100644 index 0000000..44ff715 --- /dev/null +++ b/src/pfor/expression/info.h @@ -0,0 +1,76 @@ +#ifndef PFOR_PFOR_EXPRESSION_INFO_H +#define PFOR_PFOR_EXPRESSION_INFO_H + +#include "access.h" +#include "expression.h" +#include "operandtag.h" +#include "tagger.h" +#include "../mp/pack.h" +#include "../mp/meta.h" + +namespace pfor { +namespace expr { + +namespace impl { + +/** + * @brief filters variables ids from an expression depending on access category + */ +template struct RWListImpl; + +template +struct RWListImpl, Ts...>, accessReq> { + using trail = typename RWListImpl, accessReq>::type; + using type = pfor::If, trail>; +}; + +template +struct RWListImpl, Ts...>, accessReq> { + using type = typename RWListImpl, accessReq>::type; +}; + +template +struct RWListImpl, accessReq> { + using type = Pack<>; +}; + +template +using RWList = typename RWListImpl::type; + +} + +template +using ReadList = impl::RWList; + +template +using WriteList = impl::RWList; + +/** + * @brief returns informations about the input expression + */ +template struct ExpressionInfoImpl; + +template +struct ExpressionInfoImpl> { + using trail = typename ExpressionInfoImpl>::type; + using exprtags = ExpressionTagger; + using read = ReadList; + using write = WriteList; + using type = PackPrepend, write, read>>; +}; + +template +struct ExpressionInfoImpl> { + using type = Pack<>; +}; + +template +using ExpressionInfo = typename ExpressionInfoImpl<0, T>::type; + +// template +// using SortedExpressionInfo = PackSort::type>; + +} +} + +#endif diff --git a/src/pfor/expression/op.h b/src/pfor/expression/op.h new file mode 100644 index 0000000..31b6233 --- /dev/null +++ b/src/pfor/expression/op.h @@ -0,0 +1,211 @@ +#ifndef PFOR_PFOR_EXPRESSION_OP_H +#define PFOR_PFOR_EXPRESSION_OP_H + +#include "access.h" +#include "optraits.h" +#include "traits.h" + +#define PFOR_EXPR_DEF_OPERATION_UNARY(OPNAME, OPSYM) \ + struct OPNAME { \ + template>* = nullptr> \ + inline static decltype(auto) eval(T&& value) { \ + return OPSYM std::forward(value).eval(); \ + } \ + template \ + inline static decltype(auto) eval(long i, T&& value) { \ + return OPSYM std::forward(value)[i]; \ + } \ + } + +#define PFOR_EXPR_DEF_OPERATION_POST_UNARY(OPNAME, OPSYM) \ + struct OPNAME { \ + template>* = nullptr> \ + inline static decltype(auto) eval(T&& value) { \ + return std::forward(value).eval() OPSYM; \ + } \ + template \ + inline static decltype(auto) eval(long i, T&& value) { \ + return std::forward(value)[i] OPSYM; \ + } \ + } + +#define PFOR_EXPR_DEF_OPERATION_BINARY(OPNAME, OPSYM) \ + struct OPNAME { \ + template>* = nullptr> \ + inline static decltype(auto) eval(Lhs&& lhs, Rhs&& rhs) { \ + return std::forward(lhs).eval() OPSYM std::forward(rhs).eval(); \ + } \ + template \ + inline static decltype(auto) eval(long i, Lhs&& lhs, Rhs&& rhs) { \ + return std::forward(lhs)[i] OPSYM std::forward(rhs)[i]; \ + } \ + } + +namespace pfor { +namespace expr { +namespace op { + +/* from: http://en.cppreference.com/w/cpp/language/operator_precedence + * excluding non overloadable operators + * + * [02] a++, a--, a(), a[] + * [03] ++a, --a, +a, -a, !a, ~a, *a, &a + * [04] ->* + * [05] a*b, a/b, a%b + * [06] a+b, a-b + * [07] <<, >> + * [08] <, <=, >, >= + * [09] ==, != + * [10] a&b + * [11] ^ + * [12] | + * [13] && + * [14] || + * [15] =, +=, -=, *=, /=, %=, <<=, >>=, &=, ^=, |= + * [16] , + */ + +/* ===== Unary ===== */ +PFOR_EXPR_DEF_OPERATION_POST_UNARY(PostIncr, ++); +PFOR_EXPR_DEF_OPERATION_POST_UNARY(PostDecr, --); + +PFOR_EXPR_DEF_OPERATION_UNARY(PreIncr, ++); +PFOR_EXPR_DEF_OPERATION_UNARY(PreDecr, --); +PFOR_EXPR_DEF_OPERATION_UNARY(Plus, +); +PFOR_EXPR_DEF_OPERATION_UNARY(Minus, -); +PFOR_EXPR_DEF_OPERATION_UNARY(Not, !); +PFOR_EXPR_DEF_OPERATION_UNARY(BitNot, ~); +PFOR_EXPR_DEF_OPERATION_UNARY(Indirection, *); +PFOR_EXPR_DEF_OPERATION_UNARY(AddressOf, &); + +/* ===== Binary ===== */ +PFOR_EXPR_DEF_OPERATION_BINARY(PtrToMem, ->*); +PFOR_EXPR_DEF_OPERATION_BINARY(Multiplication, *); +PFOR_EXPR_DEF_OPERATION_BINARY(Division, /); +PFOR_EXPR_DEF_OPERATION_BINARY(Modulo, %); +PFOR_EXPR_DEF_OPERATION_BINARY(Addition, +); +PFOR_EXPR_DEF_OPERATION_BINARY(Subtraction, -); +PFOR_EXPR_DEF_OPERATION_BINARY(LeftShift, <<); +PFOR_EXPR_DEF_OPERATION_BINARY(RightShift, >>); +PFOR_EXPR_DEF_OPERATION_BINARY(Lower, <); +PFOR_EXPR_DEF_OPERATION_BINARY(LowerEqual, <=); +PFOR_EXPR_DEF_OPERATION_BINARY(Greater, >); +PFOR_EXPR_DEF_OPERATION_BINARY(GreaterEqual, >=); +PFOR_EXPR_DEF_OPERATION_BINARY(Equal, ==); +PFOR_EXPR_DEF_OPERATION_BINARY(NotEqual, !=); +PFOR_EXPR_DEF_OPERATION_BINARY(BitAnd, &); +PFOR_EXPR_DEF_OPERATION_BINARY(BitXor, ^); +PFOR_EXPR_DEF_OPERATION_BINARY(BitOr, |); +PFOR_EXPR_DEF_OPERATION_BINARY(And, &&); +PFOR_EXPR_DEF_OPERATION_BINARY(Or, ||); +PFOR_EXPR_DEF_OPERATION_BINARY(Assign, =); +PFOR_EXPR_DEF_OPERATION_BINARY(AssignAdd, +=); +PFOR_EXPR_DEF_OPERATION_BINARY(AssignSub, -=); +PFOR_EXPR_DEF_OPERATION_BINARY(AssignMul, *=); +PFOR_EXPR_DEF_OPERATION_BINARY(AssignDiv, /=); +PFOR_EXPR_DEF_OPERATION_BINARY(AssignMod, %=); +PFOR_EXPR_DEF_OPERATION_BINARY(AssignLS, <<=); +PFOR_EXPR_DEF_OPERATION_BINARY(AssignRS, >>=); +PFOR_EXPR_DEF_OPERATION_BINARY(AssignAnd, &=); +PFOR_EXPR_DEF_OPERATION_BINARY(AssignXor, ^=); +PFOR_EXPR_DEF_OPERATION_BINARY(AssignOr, |=); + +struct Subscript { + template>* = nullptr> + inline static decltype(auto) eval(T&& t, Index&& index) { + return std::forward(t).eval()[std::forward(index).eval()]; + } + + template + inline static decltype(auto) eval(long i, T&& t, Index&& index) { + return std::forward(t)[i][std::forward(index)[i]]; + } +}; + +struct Comma { + template>* = nullptr> + inline static decltype(auto) eval(Lhs&& lhs, Rhs&&... rhs) { + return std::forward(lhs).eval(), eval(std::forward(rhs)...); + } + + template>* = nullptr> + inline static decltype(auto) eval(Lhs&& lhs, Rhs&& rhs) { + return std::forward(lhs).eval(), std::forward(rhs).eval(); + } + + template + inline static decltype(auto) eval(long i, Lhs&& lhs, Rhs&&... rhs) { + return std::forward(lhs)[i], eval(i, std::forward(rhs)...); + } + + template + inline static decltype(auto) eval(long i, Lhs&& lhs, Rhs&& rhs) { + return std::forward(lhs)[i], std::forward(rhs)[i]; + } + + template + inline static decltype(auto) eval(long i, Lhs&& lhs) { + return std::forward(lhs)[i]; + } +}; + +/* ===== Ternary ===== */ +struct If { + template>* = nullptr> + inline static decltype(auto) eval(Cond&& cond, T&& t, F&& f) { + return std::forward(cond).eval()? std::forward(t).eval():std::forward(f).eval(); + } + + template + inline static decltype(auto) eval(long i, Cond&& cond, T&& t, F&& f) { + return std::forward(cond)[i]? std::forward(t)[i]:std::forward(f)[i]; + } +}; + +/* ==== N-ary ===== */ +struct FunctionCall { + template>* = nullptr> + inline static decltype(auto) eval(F&& f, Ts&&... values) { + return std::forward(f).eval()(std::forward(values).eval()...); + } + + template + inline static decltype(auto) eval(long i, F&& f, Ts&&... values) { + return std::forward(f)[i](std::forward(values)[i]...); + } +}; + +#undef PFOR_EXPR_DEF_OPERATION_POST_UNARY +#undef PFOR_EXPR_DEF_OPERATION_UNARY +#undef PFOR_EXPR_DEF_OPERATION_BINARY + +template +struct View; + +} + +#define PFOR_EXPR_SPECIALIZE_ASSIGN(O) \ + template \ + struct OperationTraits { \ + static constexpr Access access = Access::write; \ + } + +PFOR_EXPR_SPECIALIZE_ASSIGN(Assign); +PFOR_EXPR_SPECIALIZE_ASSIGN(AssignAdd); +PFOR_EXPR_SPECIALIZE_ASSIGN(AssignSub); +PFOR_EXPR_SPECIALIZE_ASSIGN(AssignMul); +PFOR_EXPR_SPECIALIZE_ASSIGN(AssignDiv); +PFOR_EXPR_SPECIALIZE_ASSIGN(AssignMod); +PFOR_EXPR_SPECIALIZE_ASSIGN(AssignLS); +PFOR_EXPR_SPECIALIZE_ASSIGN(AssignRS); +PFOR_EXPR_SPECIALIZE_ASSIGN(AssignAnd); +PFOR_EXPR_SPECIALIZE_ASSIGN(AssignXor); +PFOR_EXPR_SPECIALIZE_ASSIGN(AssignOr); + +#undef PFOR_EXPR_SPECIALIZE_ASSIGN + +} +} + +#endif diff --git a/src/pfor/expression/operand.h b/src/pfor/expression/operand.h new file mode 100644 index 0000000..403c90e --- /dev/null +++ b/src/pfor/expression/operand.h @@ -0,0 +1,16 @@ +#ifndef PFOR_PFOR_EXPRESSION_OPERAND_H +#define PFOR_PFOR_EXPRESSION_OPERAND_H + +#include "expression.h" + +#define DECLARE_OP(TYPE, NAME, SIZE, VALUES) \ + TYPE NAME##_[SIZE]VALUES; Operand NAME{NAME##_} + +namespace pfor { + +template +using Operand = expr::Expression; + +} + +#endif diff --git a/src/pfor/expression/operandtag.h b/src/pfor/expression/operandtag.h new file mode 100644 index 0000000..e44a170 --- /dev/null +++ b/src/pfor/expression/operandtag.h @@ -0,0 +1,22 @@ +#ifndef PFOR_PFOR_EXPRESSION_OPERANDTAG_H +#define PFOR_PFOR_EXPRESSION_OPERANDTAG_H + +#include "access.h" + +namespace pfor { +namespace expr { + +/** + * Expression node meta information + */ +template +struct OperandTag { + using ID = Id_; + static constexpr Access RW = access_; + using Index = Index_; +}; + +} +} + +#endif diff --git a/src/pfor/expression/operators.h b/src/pfor/expression/operators.h new file mode 100644 index 0000000..8d0bead --- /dev/null +++ b/src/pfor/expression/operators.h @@ -0,0 +1,137 @@ +#ifndef PFOR_PFOR_EXPRESSION_OPERATORS_H +#define PFOR_PFOR_EXPRESSION_OPERATORS_H + +#include "asexpression.h" +#include "expression.h" +#include "op.h" + +#define PFOR_EXPR_DEF_UN_OP(OP, OPSYM) \ + template>* = nullptr> \ + inline auto operator OPSYM(T const& t) { return Expression{{}, t}; } + +#define PFOR_EXPR_DEF_BIN_OP(OP, OPSYM) \ + template>* = nullptr> \ + inline auto operator OPSYM(Lhs const& lhs, Rhs const& rhs) { \ + return Expression, AsExpression>{{}, lhs, rhs}; \ + } + +#define PFOR_EXPR_DEF_OPS() \ + PFOR_EXPR_DEF_UN_OP (op::Plus, +) \ + PFOR_EXPR_DEF_UN_OP (op::Minus, -) \ + PFOR_EXPR_DEF_UN_OP (op::Not, !) \ + PFOR_EXPR_DEF_UN_OP (op::BitNot, ~) \ + PFOR_EXPR_DEF_UN_OP (op::Indirection, *) \ + PFOR_EXPR_DEF_UN_OP (op::AddressOf, &) \ + \ + PFOR_EXPR_DEF_BIN_OP(op::Multiplication, *) \ + PFOR_EXPR_DEF_BIN_OP(op::Division, /) \ + PFOR_EXPR_DEF_BIN_OP(op::Modulo, %) \ + PFOR_EXPR_DEF_BIN_OP(op::Addition, +) \ + PFOR_EXPR_DEF_BIN_OP(op::Subtraction, -) \ + PFOR_EXPR_DEF_BIN_OP(op::LeftShift, <<) \ + PFOR_EXPR_DEF_BIN_OP(op::RightShift, >>) \ + PFOR_EXPR_DEF_BIN_OP(op::Lower, <) \ + PFOR_EXPR_DEF_BIN_OP(op::LowerEqual, <=) \ + PFOR_EXPR_DEF_BIN_OP(op::Greater, >) \ + PFOR_EXPR_DEF_BIN_OP(op::GreaterEqual, >=) \ + PFOR_EXPR_DEF_BIN_OP(op::Equal, ==) \ + PFOR_EXPR_DEF_BIN_OP(op::NotEqual, !=) \ + PFOR_EXPR_DEF_BIN_OP(op::BitAnd, &) \ + PFOR_EXPR_DEF_BIN_OP(op::BitXor, ^) \ + PFOR_EXPR_DEF_BIN_OP(op::BitOr, |) \ + PFOR_EXPR_DEF_BIN_OP(op::And, &&) \ + PFOR_EXPR_DEF_BIN_OP(op::Or, ||) \ + PFOR_EXPR_DEF_BIN_OP(op::AssignAdd, +=) \ + PFOR_EXPR_DEF_BIN_OP(op::AssignSub, -=) \ + PFOR_EXPR_DEF_BIN_OP(op::AssignMul, *=) \ + PFOR_EXPR_DEF_BIN_OP(op::AssignDiv, /=) \ + PFOR_EXPR_DEF_BIN_OP(op::AssignMod, %=) \ + PFOR_EXPR_DEF_BIN_OP(op::AssignLS, <<=) \ + PFOR_EXPR_DEF_BIN_OP(op::AssignRS, >>=) \ + PFOR_EXPR_DEF_BIN_OP(op::AssignAnd, &=) \ + PFOR_EXPR_DEF_BIN_OP(op::AssignXor, ^=) \ + PFOR_EXPR_DEF_BIN_OP(op::AssignOr, |=) + +namespace pfor { +namespace expr { + +PFOR_EXPR_DEF_OPS(); + +template +inline decltype(auto) If(Cond const& cond, T const& t, F const& f) { + return Expression{{}, cond, t, f}; +} + +/** + */ +template struct CommaMergerImpl; + +template +struct CommaMergerImpl, Expression> { + using type = Expression, Expression>; +}; + +template +struct CommaMergerImpl, Expression> { + using type = Expression>; +}; + +template +struct CommaMergerImpl, Expression> { + using type = Expression, RTs...>; +}; + +template +struct CommaMergerImpl, Expression> { + using type = Expression; +}; + +template +using CommaMerger = typename CommaMergerImpl::type; + +/** + */ +template>* = nullptr> +inline auto commaMerger(Ts... ts) { + return Expression{{}, ts...}; +} + +template +inline auto commaMerger(std::tuple const& lhs, + std::index_sequence const&, + std::tuple const& rhs, + std::index_sequence const&) { + return Expression{{}, std::get(lhs)..., std::get(rhs)...}; +} + +template::value>* = nullptr, std::enable_if_t::value>* = nullptr> +inline auto operator,(Expression const& lhs, Expression const& rhs) { + using Lhs = Expression; + using Rhs = Expression; + return CommaMerger{{}, lhs, rhs}; +} + +template::value>* = nullptr> +inline auto operator,(Expression const& lhs, Expression const& rhs) { + return commaMerger(std::make_tuple(lhs), std::make_index_sequence<1>{}, rhs.operands, std::make_index_sequence{}); +} + +template::value>* = nullptr> +inline auto operator,(Expression const& lhs, Expression const& rhs) { + return commaMerger(lhs.operands, std::make_index_sequence{}, std::make_tuple(rhs), std::make_index_sequence<1>{}); +} + +template +inline auto operator,(Expression const& lhs, Expression const& rhs) { + return commaMerger(lhs.operands, std::make_index_sequence{}, rhs.operands, std::make_index_sequence{}); +} + +} +} + +#undef PFOR_EXPR_DEF_UN_OP +#undef PFOR_EXPR_DEF_BIN_OP +#undef PFOR_EXPR_DEF_OPS + +#endif diff --git a/src/pfor/expression/optraits.h b/src/pfor/expression/optraits.h new file mode 100644 index 0000000..f74cedb --- /dev/null +++ b/src/pfor/expression/optraits.h @@ -0,0 +1,19 @@ +#ifndef PFOR_PFOR_EXPRESSION_OPTRAITS_H +#define PFOR_PFOR_EXPRESSION_OPTRAITS_H + +#include + +#include "access.h" + +namespace pfor { +namespace expr { + +template +struct OperationTraits { + static constexpr Access access = Access::read; +}; + +} +} + +#endif diff --git a/src/pfor/expression/subexpression.h b/src/pfor/expression/subexpression.h new file mode 100644 index 0000000..f75570f --- /dev/null +++ b/src/pfor/expression/subexpression.h @@ -0,0 +1,55 @@ +#ifndef PFOR_PFOR_EXPRESSION_SUBEXPRESSION_H +#define PFOR_PFOR_EXPRESSION_SUBEXPRESSION_H + +#include + +#include "../expression/operators.h" + +namespace pfor { +namespace expr { + +template struct SubExpressionImpl; + +template class P, typename Expr, typename... Exprs> +struct SubExpressionImpl> { + using type = CommaMerger>::type>; +}; + +template class P, typename Expr> +struct SubExpressionImpl> { + using type = Expression; +}; + +template +using SubExpression = typename SubExpressionImpl

; + using NewProperties = PackUnion; + using type = typename InferWhileNewProperties > packSize

)>::type; + }; + + template + struct InferWhileNewProperties { + using type = P; + }; + + using type = typename InferWhileNewProperties::type; +}; + +template +using ComputeProperties = typename ComputePropertiesImpl::type; + +/** + * @brief adds properties to the properties set + * + * @param S the properties set + * @param P the new properties to add + * + * @return the new set of properties, including inferred properties + */ +template +using AddProperties = PackUnion>>; + +} +} + +#endif diff --git a/src/pfor/index/tag.h b/src/pfor/index/tag.h new file mode 100644 index 0000000..895d683 --- /dev/null +++ b/src/pfor/index/tag.h @@ -0,0 +1,14 @@ +#ifndef PFOR_PFOR_INDEX_TAG_H +#define PFOR_PFOR_INDEX_TAG_H + +namespace pfor { +namespace index { +namespace tag { + +struct Index; + +} +} +} + +#endif diff --git a/src/pfor/index/traits.h b/src/pfor/index/traits.h new file mode 100644 index 0000000..5216319 --- /dev/null +++ b/src/pfor/index/traits.h @@ -0,0 +1,66 @@ +#ifndef PFOR_PFOR_INDEX_TRAITS_H +#define PFOR_PFOR_INDEX_TRAITS_H + +#include + +#include "index.h" +#include "op.h" +#include "tag.h" +#include "../mp/pack.h" + +namespace pfor { +namespace index { + +/** + * @brief tests a type and return true if it is an index expression + * + * @return true if the type is an index expression + */ +template +struct IsIndexImpl: std::false_type {}; + +template +struct IsIndexImpl::IsIndex, tag::Index>{}>>: std::true_type {}; + +template +struct IsIndex: IsIndexImpl {}; + +template +constexpr bool isIndex = IsIndex::value; + +/** + * @brief tests a pack of types and returns true is all are index expressions + */ +template struct AllIndex: std::integral_constant, IsIndex>> {}; + +template +constexpr bool allIndex = AllIndex::value; + +/** + */ +template struct IsConstant: std::true_type {}; + +template +struct IsConstant>: std::false_type {}; + +template +struct IsConstant, P>> { + static constexpr bool value = IsConstant::value && IsConstant::value; +}; + +template +struct IsConstant, Rhs>, P>>: std::false_type {}; + +template +struct IsConstant>, P>>: std::false_type {}; + +template +struct IsConstant, IndexP>, P>>: std::false_type {}; + +template +constexpr bool isConstant = IsConstant::value; + +} +} + +#endif diff --git a/src/pfor/lineardiophantineequation.h b/src/pfor/lineardiophantineequation.h new file mode 100644 index 0000000..21c4b01 --- /dev/null +++ b/src/pfor/lineardiophantineequation.h @@ -0,0 +1,70 @@ +#ifndef PFOR_PFOR_LINEARDIOPHANTINEEQUATION_H +#define PFOR_PFOR_LINEARDIOPHANTINEEQUATION_H + +#include "expression/operandtag.h" +#include "index/property/linear.h" +#include "index/traits.h" +#include "mp/meta.h" +#include "mp/pack.h" + +namespace pfor { + +/** + */ +template +constexpr bool hasLinearDiophantineSolution = ((c % gcd(a, b)) == 0); + +template +constexpr bool hasLinearDiophantineSolution<0, 0, c> = false; + +/** + */ +template struct NoLinearDiophantineSolution; + +template +struct NoLinearDiophantineSolution: std::true_type {}; + +template +struct NoLinearDiophantineSolution { + static constexpr index::Value a = index::linearSlope; + static constexpr index::Value b = -index::linearSlope; + static constexpr index::Value c = index::linearOffset-index::linearOffset; + static constexpr bool value = not hasLinearDiophantineSolution; +}; + +template +constexpr bool noLinearDiophantineSolution = NoLinearDiophantineSolution::value; + +/** + */ +template struct NoLinearDiophantineSolutionForVec; + +template +struct NoLinearDiophantineSolutionForVec> { + static constexpr bool value = noLinearDiophantineSolution && NoLinearDiophantineSolutionForVec>::value; +}; + +template +struct NoLinearDiophantineSolutionForVec>: std::true_type {}; + +template +constexpr bool noLinearDiophantineSolutionForVec = NoLinearDiophantineSolutionForVec::value; + +/** + */ +template struct NoLinearDiophantineSolutionForGrid; + +template +struct NoLinearDiophantineSolutionForGrid, P> { + static constexpr bool value = noLinearDiophantineSolutionForVec && NoLinearDiophantineSolutionForGrid, P>::value; +}; + +template +struct NoLinearDiophantineSolutionForGrid, P>: std::true_type {}; + +template +constexpr bool noLinearDiophantineSolutionForGrid = NoLinearDiophantineSolutionForGrid::value; + +} + +#endif diff --git a/src/pfor/mp/meta.h b/src/pfor/mp/meta.h new file mode 100644 index 0000000..cca4103 --- /dev/null +++ b/src/pfor/mp/meta.h @@ -0,0 +1,91 @@ +#ifndef PFOR_PFOR_MP_META_H +#define PFOR_PFOR_MP_META_H + +#include +#include + +namespace pfor { + +/** + * compile-time type to store unsigned integers + */ +template +struct UIntToType { + using value_type = std::size_t; + static constexpr value_type value = v; +}; + +/** + * compile-time type to store integers + */ +template +struct IntToType { + using value_type = long; + static constexpr value_type value = v; +}; + +/** + * If + * returns first type if condition is true, else second type + */ +template struct IfImpl; + +template +struct IfImpl { + using type = F; +}; +template +struct IfImpl { + using type = T; +}; + +template +using If = typename IfImpl::type; + +/** + */ +template class F, typename P, typename V, typename Af> struct Accumulate; + +template class F, template class P, typename T, typename... Ts, typename V, typename Af> +struct Accumulate, V, Af> { + static decltype(auto) eval(V const& value, Af const& f) { + return Accumulate, V, Af>::eval(f(value, +F::value), f); + } +}; + +template class F, template class P, typename V, typename Af> +struct Accumulate, V, Af> { + static V eval(V const& value, Af const&) { return value; } +}; + +template class F, typename P, typename V, typename Af> +decltype(auto) accumulate(V const& value, Af const& f) { + return Accumulate::eval(value, f); +} + +/** + * @brief computes the GCD of two integers + * + * @param a an integer + * @param b an integer + * + * @return GCD(A, B) + */ +namespace impl { + +constexpr long gcd(long a, long b) { + if(!b) return a; + return gcd(b, a%b); +} + +} + +constexpr long gcd(long a, long b) { + if(a < 0) a = -a; + if(b < 0) b = -b; + return impl::gcd(a, b); +} + +} + +#endif diff --git a/src/pfor/mp/pack.h b/src/pfor/mp/pack.h new file mode 100644 index 0000000..a3f5313 --- /dev/null +++ b/src/pfor/mp/pack.h @@ -0,0 +1,476 @@ +#ifndef PFOR_PFOR_MP_PACK_H +#define PFOR_PFOR_MP_PACK_H + +#include "meta.h" + +namespace pfor { + +/** + * Pack data structure containing types + */ +template struct Pack {}; + +/** + * @brief tests if P is a pack + * + * @param P + * + * @return true if P is a pack + */ +template struct IsPack: std::false_type {}; + +template +struct IsPack>: std::true_type {}; + +template +constexpr bool isPack = IsPack

::value; + +/** + * @brief access a pack element by its index + * + * @param P a pack + * @param I an index + * + * @return the pack element at index I + */ +template struct PackGetImpl; + +template +struct PackGetImpl, UIntToType> { + using type = typename PackGetImpl, UIntToType>::type; +}; + +template +struct PackGetImpl, UIntToType<0>> { + using type = T; +}; + +template +using PackGet = typename PackGetImpl>::type; + +/** + * @brief computes the size of a pack + * + * @param P a pack + * + * @return the size of P + */ +template struct PackSize; + +template +struct PackSize> { + static constexpr std::size_t value = sizeof...(Ts); +}; + +template +constexpr std::size_t packSize = PackSize

::value; + +/** + * @brief appends a type to a pack + * + * @param P a pack (P0, ..., Pn) + * @param T a type + * + * @return a new pack (P0, ..., Pn, T) + */ +template struct PackAppendImpl; + +template +struct PackAppendImpl, T> { + using type = Pack; +}; + +template +using PackAppend = typename PackAppendImpl::type; + +/** + * @brief prepends a type to a pack + * + * @param P a pack (P0, ..., Pn) + * @param T a type + * + * @return a new pack (T, P0, ..., Pn) + */ +template struct PackPrependImpl; + +template +struct PackPrependImpl, T> { + using type = Pack; +}; + +template +using PackPrepend = typename PackPrependImpl::type; + +/** + * @brief removes all occurrences a given type in a pack + * + * @param P a pack (P0, ..., Pn) + * @param T a type + * + * @return a new pack (P'0, ..., P'm) with P'i != T + */ +template> struct PackRemoveImpl; + +template +struct PackRemoveImpl, E, Pack> { + using pack = If{}, Pack, Pack>; + using type = typename PackRemoveImpl, E, pack>::type; +}; + +template +struct PackRemoveImpl, E, Out> { + using type = Out; +}; + +template +using PackRemove = typename PackRemoveImpl::type; + +/** + * @brief tests a pack for any occurrence of a given type + * + * @param P a pack (P0, ... Pn) + * @param T a type + * + * @return true if any Pi == T + */ +template struct PackContains; + +template +struct PackContains, T> { + static constexpr bool value = std::is_same::value || PackContains, T>::value; +}; + +template +struct PackContains, T> { + static constexpr bool value = false; +}; + +template +constexpr bool packContains = PackContains::value; + +/** + * @brief tests if a pack contains another pack + * + * @param P a pack (P0, ..., Pn) + * @param Q a pack (Q0, ..., Qn) + * + * @return true if all Qi are in P + */ +template struct PackContainsAll; + +template +struct PackContainsAll> { + static constexpr bool value = packContains && PackContainsAll>::value; +}; + +template +struct PackContainsAll> { + static constexpr bool value = true; +}; + +template +constexpr bool packContainsAll = PackContainsAll::value; + +/** + * @brief tests if two packs intersect (non empty intersection) + * + * @param P0 a pack (P00, ..., P0n) + * @param P1 a pack (P10, ..., P1n) + * + * @return true if any P0i == P1j + */ +template struct PackIntersects; + +template +struct PackIntersects> { + static constexpr bool value = packContains || PackIntersects>::value; +}; + +template +struct PackIntersects> { + static constexpr bool value = false; +}; + +template +constexpr bool packIntersects = PackIntersects::value; + +/** + * @brief inserts a new element in not already contained + * + * @param P a pack (P0, ..., Pn) + * @param T a new element + * + * @return a pack (P0, ..., Pn, T) if T != Pi, else P + */ +template +struct PackInsertUniqImpl { + using type = If, P, PackAppend>; +}; + +template +using PackInsetUniq = typename PackInsertUniqImpl::type; + +/** + * @brief computes a new pack containing any element only once + * + * @param P a pack (P0, ..., Pn) + * + * @return a pack (P'0, ..., P'm) with P'i != P'j for i != j + */ +template> struct PackUniqImpl; + +template +struct PackUniqImpl, Pack> { + using out = If, IH>, Pack, Pack>; + using type = typename PackUniqImpl, out>::type; +}; + +template +struct PackUniqImpl, Pack> { + using type = Pack; +}; + +template +using PackUniq = typename PackUniqImpl

::type; + +/** + * @brief merges packs + * + * @param Ps a list of packs (P00, ..., P0n0)...(Px0, ..., Pxnx) + * + * @return a new pack (P00, ..., P0n0, ..., Px0, ..., Pxnx) + */ +template struct PackMergeImpl; + +template +struct PackMergeImpl, Pack, Trail...> { + using type = typename PackMergeImpl, Trail...>::type; +}; + +template +struct PackMergeImpl> { + using type = Pack; +}; + +template<> +struct PackMergeImpl<> { + using type = Pack<>; +}; + +template +using PackMerge = typename PackMergeImpl::type; + +/** + * @brief merges unique elements from packs + * + * @param Ps a list of packs (P00, ..., P0n0)...(Px0, ..., Pxnx) + * + * @return the union of all packs Ps + */ +template struct PackUnionImpl { + using type = PackUniq>; +}; + +template +using PackUnion = typename PackUnionImpl::type; + +namespace impl { + +/** + * @brief computes a pack containing elements before a given one + * + * @param Comparator a comparator + * @param P a pack (P0, ..., Pn) + * @param T a type + * + * @return a new pack with elements before T + */ +namespace detail { + +template class, typename, typename, typename> struct PackSortBeforeImpl; + +template class Comparator, typename... Bs, typename T, typename... Ts, typename U> +struct PackSortBeforeImpl, Pack, U> { + using trail = typename PackSortBeforeImpl, Pack, U>::type; + using type = If::value, trail, Pack>; +}; + +template class Comparator, typename... Bs, typename U> +struct PackSortBeforeImpl, Pack<>, U> { + using type = Pack; +}; + +template class Comparator, typename P, typename T> +using PackSortBefore = typename PackSortBeforeImpl, P, T>::type; + +} + +template class, typename, typename> struct PackSortBeforeImpl; + +template class Comparator, typename... Ts, typename U> +struct PackSortBeforeImpl, U> { + using type = detail::PackSortBefore, U>; +}; + +template class Comparator, typename P, typename T> +using PackSortBefore = typename PackSortBeforeImpl::type; + +/** + * @brief computes a pack containing elements after a given one + * + * @param Comparator a comparator + * @param P a pack (P0, ..., Pn) + * @param T a type + * + * @return a new pack with elements after T + */ +namespace detail { + +template class, typename, typename, typename> struct PackSortAfterImpl; + +template class Comparator, typename... Bs, typename T, typename... Ts, typename U> +struct PackSortAfterImpl, Pack, U> { + using trail = typename PackSortAfterImpl, Pack, U>::type; + using type = If::value, trail, Pack>; +}; + +template class Comparator, typename... Bs, typename U> +struct PackSortAfterImpl, Pack<>, U> { + using type = Pack<>; +}; + +template class Comparator, typename P, typename T> +using PackSortAfter = typename PackSortAfterImpl, P, T>::type; + +} + +template class, typename, typename> struct PackSortAfterImpl; + +template class Comparator, typename... Ts, typename U> +struct PackSortAfterImpl, U> { + using type = detail::PackSortAfter, U>; +}; + +template class Comparator, typename P, typename T> +using PackSortAfter = typename PackSortAfterImpl::type; + +} + +/** + * @brief insert an element into a sorted pack + * + * @param Comparator a comparator + * @param P a sorted pack + * @param T a type + * + * @return a new sorted pack containing T + */ +template class, typename, typename> struct PackSortInsertImpl; + +template class Comparator, typename... Ts, typename T> +struct PackSortInsertImpl, T> { + using before = impl::PackSortBefore, T>; + using after = impl::PackSortAfter, T>; + + using type = PackMerge, after>; +}; + +template class Comparator, typename P, typename T> +using PackSortInsert = typename PackSortInsertImpl::type; + +/** + * @brief sorts a pack + * + * @param Comparator a comparator + * @param P a pack + * + * @return a sorted pack + */ +template class, typename> struct PackSortImpl; + +template class Comparator, typename T, typename... Ts> +struct PackSortImpl> { + using trail = typename PackSortImpl>::type; + using type = PackSortInsert; +}; + +template class Comparator> +struct PackSortImpl> { + using type = Pack<>; +}; + +template class Comparator, typename P> +using PackSort = typename PackSortImpl::type; + +/** + * @brief applies a metafunction to each type in a pack + * + * @param P a pack + * @param F a metafunction + * + * @return a transformed pack + */ +template class> struct PackForEachImpl; + +template class F> +struct PackForEachImpl, F> { + using type = PackPrepend, F>::type, F>; +}; + +template class F> +struct PackForEachImpl, F> { + using type = Pack<>; +}; + +template class F> +using PackForEach = typename PackForEachImpl::type; + +/** + * @brief checks a property for each element and returns true if all are true + * + * @param P a pack + * @param F a metafunction Pi -> bool + * + * @return true if all F::value are true + */ +template class> struct PackAll; + +template class F> +struct PackAll, F> { + static constexpr bool value = F::value && PackAll, F>::value; +}; + +template class F> +struct PackAll, F> { + static constexpr bool value = true; +}; + +template class F> +constexpr bool packAll = PackAll::value; + +/** + * @brief checks a property for each element and returns true if any is true + * + * @param P a pack + * @param F a metafunction Pi -> bool + * + * @return true if any F::value is true + */ +template class> struct PackAny; + +template class F> +struct PackAny, F> { + static constexpr bool value = F::value || PackAll, F>::value; +}; + +template class F> +struct PackAny, F> { + static constexpr bool value = false; +}; + +template class F> +constexpr bool packAny = PackAny::value; + +} + +#endif diff --git a/src/pfor/mp/tuple.h b/src/pfor/mp/tuple.h new file mode 100644 index 0000000..69571a9 --- /dev/null +++ b/src/pfor/mp/tuple.h @@ -0,0 +1,27 @@ +#ifndef PFOR_PFOR_MP_TUPLE_H +#define PFOR_PFOR_MP_TUPLE_H + +#include "pack.h" + +namespace pfor { + +template struct SubTupleImpl; + +/* // more generic version +template class Tuple, typename... Ts, template class Indices, template class Index, std::size_t... indices> +struct SubTupleImpl, Indices...>> { + using type = Tuple, indices>...>; +}; +*/ + +template +struct SubTupleImpl, Pack...>> { + using type = std::tuple, indices>...>; +}; + +template +using SubTuple = typename SubTupleImpl::type; + +} + +#endif diff --git a/src/pfor/parallel_for.h b/src/pfor/parallel_for.h new file mode 100644 index 0000000..f7afca8 --- /dev/null +++ b/src/pfor/parallel_for.h @@ -0,0 +1,148 @@ +#ifndef PFOR_PFOR_PARALLEL_FOR_H +#define PFOR_PFOR_PARALLEL_FOR_H + +#include +#include + +#include "algorithm.h" +#include "clusters.h" +#include "expression/subexpression.h" + +#include "strategies/loopunrolling.h" +#include "strategies/openmp.h" +#include "strategies/stdthread.h" + +namespace pfor { + +template struct CompUInt; +template +struct CompUInt, UIntToType> { + static constexpr bool value = lhs < rhs; +}; + +/** + */ +template +using ForLoopDefault = ForLoopOMP; + +template class ForLoop, typename Cluster> +struct ParallelForImpl { + template + static void eval(Range const& range, E& e) { + auto exprView = expr::expressionView(e); + using ExprView = decltype(exprView); + + ForLoop::eval(range, exprView); + } +}; + +template class ForLoop> +struct ParallelForImpl> { + template + static void eval(Range const&, E&) {} +}; + +/** + * @brief possibly parallel for-loop + * + * @param[in] range the index range + * @param[in] e the expression to evaluate + * + * The expression is split in two clusters: + * - parallelizable instructions + * - sequential instructions + * + * Each cluster is then run accordingly + */ +template< + template class ForLoop = ForLoopDefault, + typename Range, typename E, + std::enable_if_t>* = nullptr +> +void parallelFor(Range const& range, E e) { + using Clusters = typename ClustersGen::type; + using Sequential = SequentialCluster; + using Parallel = ParallelCluster; + + ParallelForImpl::eval(range, e); + ParallelForImpl::eval(range, e); +} + +/** + * @brief possibly parallel for-loop + * + * @param[in] range the index range with compile-time known information + * @param[in] e the expression to evaluate + * + * The expression is split in two clusters: + * - parallelizable instructions + * - sequential instructions + * + * To determine if an instruction can be run in parallel, it is first + * modified depending on the range (specifically (begin, step)) + * + * Each cluster is then run accordingly + */ +template< + template class ForLoop = ForLoopDefault, + typename E, typename RT, index::Value begin, index::Value step, + std::enable_if_t>* = nullptr +> +void parallelFor(TRangeCT const& range, E e) { + using EStep = expr::MergeComma, GenSubstituteVariableInExpression::template type>>; + using Clusters = typename ClustersGen::type; + using Sequential = SequentialCluster; + using Parallel = ParallelCluster; + + ParallelForImpl::eval(range, e); + ParallelForImpl::eval(range, e); +} + +/** + * @brief possibly parallel for-loop + * + * @param[in] range the index range + * @param[in] es a pack of expressions to evaluate + * + * The expression is split in two clusters: + * - parallelizable instructions + * - sequential instructions + * + * Each cluster is then run accordingly + * + * Note: C++17 version is parallelFor(range, (es, ...)); + */ +template< + template class ForLoop = ForLoopDefault, + typename Range, typename... Es, + std::enable_if_t<(sizeof...(Es) > 1) and expr::allExpression>* = nullptr +> +void parallelFor(Range const& range, Es... es) { + parallelFor(range, commaMerger(es...)); +} + +/** + * @brief possibly parallel for-loop + * + * @param[in] range the index range + * @param[in] f a function returning the expression to evaluate + * + * The expression is split in two clusters: + * - parallelizable instructions + * - sequential instructions + * + * Each cluster is then run accordingly + */ +template< + template class ForLoop = ForLoopDefault, + typename Range, typename F, + typename E = std::decay_t()(std::declval()))>, + std::enable_if_t>* = nullptr +> +void parallelFor(Range const& range, F&& f) { + parallelFor(range, std::forward(f)(Index{})); +} + +} + +#endif diff --git a/src/pfor/parallelizable.h b/src/pfor/parallelizable.h new file mode 100644 index 0000000..1a9ffba --- /dev/null +++ b/src/pfor/parallelizable.h @@ -0,0 +1,158 @@ +#ifndef PFOR_PFOR_PARALLELIZABLE_H +#define PFOR_PFOR_PARALLELIZABLE_H + +#include "expression/access.h" +#include "expression/algorithm.h" +#include "expression/info.h" +#include "expression/operandtag.h" +#include "expression/tagger.h" +#include "index/properties.h" +#include "index/traits.h" +#include "lineardiophantineequation.h" +#include "mp/pack.h" + +namespace pfor { + +namespace impl { + +template +struct IsLinearOrInjective: std::integral_constant> or index::isInjective> +> {}; + +/** + * @brief true if all indices are linear or injective + */ +template +constexpr bool allLinearOrInjective = packAll, IsLinearOrInjective>; + +} + +/** + */ +template struct TestVariable; + +/* + * if all indices are not either linear or at least injective, default to sequential + */ +template +struct TestVariable, IncludeList, Pack, + std::enable_if_t< + not index::allLinear and + not impl::allLinearOrInjective + > +> +{ + static constexpr bool value = false; +}; + +/* + * if not only linear expressions for indices, defaults to Fw = emptyset or |F| = 1 + * when non linear still are injective + */ +template +struct TestVariable, IncludeList, Pack, + std::enable_if_t< + not index::allLinear and + impl::allLinearOrInjective + > +> +{ + using First = expr::OperandTag; + using Indices = PackUniq>::indices>; + + static constexpr std::size_t cwrite = expr::countWrite; + static constexpr std::size_t cindices = PackSize::value; + + static constexpr bool value = (cwrite == 0 || (cwrite == 1 && cindices == 1)); +}; + +/* + * if only linear expressions for indices, use linear diophantine equations + */ +template +struct TestVariable, + std::enable_if_t> +> +{ + using wtags = expr::FilterOperandTags, expr::Access::write>; + using wit = expr::IndicesFromOperandTags; + using allit = expr::IndicesFromOperandTags; + static constexpr bool value = noLinearDiophantineSolutionForGrid; +}; + +template +constexpr bool testVariable = TestVariable::value; + +/** + * ConstantWriteAccess + */ +template struct HasConstantWriteAccess; + +template +struct HasConstantWriteAccess, Ts...>> { + static constexpr bool value = index::isConstant || HasConstantWriteAccess>::value; +}; + +template +struct HasConstantWriteAccess, Ts...>> { + static constexpr bool value = HasConstantWriteAccess>::value; +}; + +template<> +struct HasConstantWriteAccess> { + static constexpr bool value = false; +}; + +template +constexpr bool hasConstantWriteAccess = HasConstantWriteAccess

::value; + +/** + * RWControl + */ +template struct RWControl; + +template +struct RWControl, Ts...>> { + using First = expr::OperandTag; + using IncludeList = expr::IncludeTags>; + using ExcludeList = expr::ExcludeTags>; + + static constexpr bool noConstantWrite = !hasConstantWriteAccess; + static constexpr bool noIndexConflict = testVariable>; + + static constexpr bool value = noConstantWrite && noIndexConflict && RWControl::value; +}; + +template<> +struct RWControl> { + static constexpr bool value = true; +}; + +template +constexpr bool rwControl = RWControl::value; + +/** + * Parallelizable + */ +template struct Parallelizable; + +template +struct Parallelizable> { + using tags = expr::ExpressionTagger>; + using filtered_tags = expr::ExcludeTags; + + static constexpr bool value = rwControl; +}; + +/** + * @param[in] E an expression + * + * @return true if the expression can be run in parallel + */ +template +constexpr bool parallelizable = Parallelizable::value; + +} + +#endif diff --git a/src/pfor/pfor.h b/src/pfor/pfor.h new file mode 100644 index 0000000..4670d8e --- /dev/null +++ b/src/pfor/pfor.h @@ -0,0 +1,13 @@ +#ifndef PFOR_PFOR_PFOR_H +#define PFOR_PFOR_PFOR_H + +#include "expression/operand.h" +#include "parallel_for.h" + +#include "expression/operators.h" +#include "index/operators.h" +#include "index/properties.h" + +#include "userop.h" + +#endif diff --git a/src/pfor/range.h b/src/pfor/range.h new file mode 100644 index 0000000..cfee31d --- /dev/null +++ b/src/pfor/range.h @@ -0,0 +1,105 @@ +#ifndef PFOR_PFOR_RANGE_H +#define PFOR_PFOR_RANGE_H + +#include + +#include "index/index.h" + +namespace pfor { + +/** + * @brief a dynamic range holder + * + * Actual class for dynamic ranges + */ +template +class TRange { +public: + using ValueType = T; + +private: + ValueType _begin; + ValueType _end; + ValueType _step; + +public: + TRange(ValueType begin, ValueType end, ValueType step = 1): + _begin{begin}, _end{end}, _step{step} + {} + + ValueType begin() const { return _begin; } + ValueType end() const { return _end; } + ValueType step() const { return _step; } +}; + +/** + * @brief a compile time value holder for TRangeCT + */ +template +struct TRangeCTValue { + constexpr operator T() const { return _value; } +}; + +/** + * @brief a static-(begin, step) and dynamic-(end) range holder + * + * Actual class for static-(begin, step) and dynamic-(end) range + */ +template +class TRangeCT { +public: + using ValueType = T; + +private: + ValueType _end; + +public: + TRangeCT(ValueType end): _end{end} {} + + constexpr auto begin() const { return TRangeCTValue{}; } + ValueType end() const { return _end; } + constexpr auto step() const { return TRangeCTValue{}; } +}; + +/** + * @brief Dynamic range (begin, end, step) + */ +using Range = TRange; + +/** + * @brief Static-(begin, step), dynamic-(end) range + */ +template +using RangeCT = TRangeCT; + +/** + * @brief helper to create a dynamic range + * + * @param[in] begin initial value + * @param[in] end post-last value + * @param[in] step incremental step + * + * @return a dynamic range + */ +template +auto makeRange(T&& begin, T&& end, T&& step) { + return TRange>{std::forward(begin), std::forward(end), std::forward(step)}; +} + +/** + * @brief helper to create a static-(begin, step) and dynamic-(end) range + * + * @param[in] begin statically known initial value + * @param[in] step statically known incremental step + * @param[in] end post-last value + * + * @return a range with (begin, step) known at compile-time + */ +template +auto makeRange(TRangeCTValue, begin>, T&& end, TRangeCTValue, step>) { + return TRangeCT, begin, step>{std::forward(end)}; +} + +} + +#endif diff --git a/src/pfor/strategies/loopunrolling.h b/src/pfor/strategies/loopunrolling.h new file mode 100644 index 0000000..13f938c --- /dev/null +++ b/src/pfor/strategies/loopunrolling.h @@ -0,0 +1,53 @@ +#ifndef PFOR_PFOR_STRATEGIES_LOOPUNROLLING_H +#define PFOR_PFOR_STRATEGIES_LOOPUNROLLING_H + +#include +#include +#include + +namespace pfor { + +template +struct ForLoopUnrolling { + template + struct Template { + using Index = typename Range::ValueType; + using Indices = std::array; + + static void eval(Range const& range, E e) { + constexpr auto indexSeq = std::make_index_sequence(); + Index const count = (range.end() - range.begin() + (range.step()-(range.step() > 0? +1 : -1)))/range.step(); + + Index const lEnd = count/n; + for(Index it{}; it != lEnd; ++it) + evalUnroll(e, indexSeq, makeIndices(indexSeq, it)); + + evalUnrollRemainder(e, indexSeq, makeIndices(indexSeq, lEnd), range.end()); + } + + private: + template + static void evalUnroll(E& e, std::index_sequence, Indices const& i) { + using Expander = int[]; + static_cast(Expander{(e[i[indices]], 0)...}); + } + + template + static void evalUnrollRemainder(E& e, std::index_sequence, Indices const& i, Index const& end) { + if(i[index] == end) return; + e[i[index]]; + evalUnrollRemainder(e, std::index_sequence{}, i, end); + } + + static void evalUnrollRemainder(E&, std::index_sequence<>, Indices const&, Index const&) {} + + template + static Indices makeIndices(std::index_sequence, Index i) { + return {(Index{n}*i+Index{indices})...}; + } + }; +}; + +} + +#endif diff --git a/src/pfor/strategies/openmp.h b/src/pfor/strategies/openmp.h new file mode 100644 index 0000000..7c42826 --- /dev/null +++ b/src/pfor/strategies/openmp.h @@ -0,0 +1,37 @@ +#ifndef PFOR_PFOR_STRATEGIES_OPENMP_H +#define PFOR_PFOR_STRATEGIES_OPENMP_H + +#include + +#include "parameters.h" + +namespace pfor { + +template struct ForLoopOMP; + +template +struct ForLoopOMP { + static void eval(Range const& range, E e) { + if(range.step() > 0) + for(auto it = +range.begin(); it < range.end(); it += range.step()) e[it]; + else + for(auto it = +range.begin(); it > range.end(); it += range.step()) e[it]; + } +}; + +template +struct ForLoopOMP { + static void eval(Range const& range, E e) { + if(range.step() > 0) { + #pragma omp parallel for num_threads(ParallelForParameters::nThreads) + for(auto it = +range.begin(); it < range.end(); it += range.step()) e[it]; + } else { + #pragma omp parallel for num_threads(ParallelForParameters::nThreads) + for(auto it = +range.begin(); it > range.end(); it += range.step()) e[it]; + } + } +}; + +} + +#endif diff --git a/src/pfor/strategies/parameters.h b/src/pfor/strategies/parameters.h new file mode 100644 index 0000000..3206607 --- /dev/null +++ b/src/pfor/strategies/parameters.h @@ -0,0 +1,14 @@ +#ifndef PFOR_PFOR_STRATEGIES_PARAMETERS_H +#define PFOR_PFOR_STRATEGIES_PARAMETERS_H + +#include + +namespace pfor { + +struct ParallelForParameters { + static std::size_t nThreads; +}; + +} + +#endif diff --git a/src/pfor/strategies/stdthread.h b/src/pfor/strategies/stdthread.h new file mode 100644 index 0000000..139e9a0 --- /dev/null +++ b/src/pfor/strategies/stdthread.h @@ -0,0 +1,60 @@ +#ifndef PFOR_PFOR_STRATEGIES_STDTHREAD_H +#define PFOR_PFOR_STRATEGIES_STDTHREAD_H + +#include +#include + +#include "../range.h" +#include "parameters.h" + +namespace pfor { + +template struct ForLoopThread; + +template +struct ForLoopThread { + static void eval(Range const& range, E e) { + if(range.step() > 0) + for(auto it = +range.begin(); it < range.end(); it += range.step()) e[it]; + else + for(auto it = +range.begin(); it > range.end(); it += range.step()) e[it]; + } +}; + +template +struct ForLoopThread { + using Index = typename Range::ValueType; + + static void eval(Range const& range, E e) { + using SeqRange = decltype(makeRange(+range.begin(), +range.end(), +range.step())); + auto const& sequence = &ForLoopThread::eval; + + Index const count = (range.end() - range.begin() + (range.step()-(range.step() > 0? +1 : -1)))/range.step(); + std::size_t const nThreads = std::min(ParallelForParameters::nThreads, count); + + std::vector threads(nThreads-1); + for(std::size_t k = 0; k < nThreads-1; ++k) { + auto lRange = makeRange( + range.begin() + static_cast(k*range.step()*count/nThreads), + range.begin() + static_cast((k+1)*range.step()*count/nThreads), + +range.step() + ); + threads[k] = std::thread{sequence, lRange, e}; + } + + { + auto lRange = makeRange( + range.begin() + static_cast((nThreads-1)*range.step()*count/nThreads), + range.end(), + +range.step() + ); + sequence(lRange, e); + } + + for(auto&& thread: threads) thread.join(); + } +}; + +} + +#endif diff --git a/src/pfor/traits.h b/src/pfor/traits.h new file mode 100644 index 0000000..69314de --- /dev/null +++ b/src/pfor/traits.h @@ -0,0 +1,64 @@ +#ifndef PFOR_PFOR_TRAITS_H +#define PFOR_PFOR_TRAITS_H + +#include "algorithm.h" +#include "clusters.h" +#include "expression/traits.h" +#include "range.h" + +namespace pfor { + +/** + * @brief tests if the given expression can be run in parallel + * + * @param[in] Range ignored range (runtime information) + * @param[in] E the expression + * + * @return true if the expression can be run in parallel + */ +template< + typename Range, typename E, + std::enable_if_t>* = nullptr +> +bool parallelTest(Range const&, E const&) { + using Expressions = expr::SplitComma; + return accumulate(true, std::logical_and{}); +} + +/** + * @brief tests if the given expression can be run in parallel given a range + * + * @param[in] begin the initial value of the index + * @param[in] step the step of the index + * @param[in] E the expression + * + * @return true if the expression can be run in parallel given (begin, step) + */ +template< + typename E, typename RT, index::Value begin, index::Value step, + std::enable_if_t>* = nullptr +> +bool parallelTest(TRangeCT const&, E const&) { + using Expressions = PackForEach, GenSubstituteVariableInExpression::template type>; + return accumulate(true, std::logical_and{}); +} + +/** + * @brief tests if the given expressions can be run in parallel, possibly given a range + * + * @param[in] Range possibly compile-time known information about the index values + * @param[in] es a pack of expressions + * + * @return true if merged expressions can be run in parallel + */ +template< + typename Range, typename... Es, + std::enable_if_t>* = nullptr +> +bool parallelTest(Range const& range, Es const&... es) { + return parallelTest(range, commaMerger(es...)); +} + +} + +#endif diff --git a/src/pfor/tuple_view.h b/src/pfor/tuple_view.h new file mode 100644 index 0000000..2ce0176 --- /dev/null +++ b/src/pfor/tuple_view.h @@ -0,0 +1,59 @@ +#ifndef PFOR_PFOR_TUPLE_VIEW_H +#define PFOR_PFOR_TUPLE_VIEW_H + +#include + +#include + +#include "mp/meta.h" +#include "mp/pack.h" + +namespace pfor { + +template class TupleView; + +template +class TupleView, Pack...>> { +public: + using Tuple = std::tuple; + using View = Pack...>; + +private: + Tuple& _tuple; + +public: + TupleView(Tuple& tuple): _tuple{tuple} {} + + template + decltype(auto) get() { + return std::get::value>(_tuple); + } + + template + decltype(auto) get() const { + return std::get::value>(_tuple); + } +}; + +template +auto makeTupleView(std::tuple& tuple, Pack...>) { + return TupleView, Pack...>>{tuple}; +} + +} + +namespace std { + +template +constexpr decltype(auto) get(pfor::TupleView& tupleView) { + return tupleView.template get(); +} + +template +constexpr decltype(auto) get(pfor::TupleView const& tupleView) { + return tupleView.template get(); +} + +} + +#endif diff --git a/src/pfor/userop.h b/src/pfor/userop.h new file mode 100644 index 0000000..98053ca --- /dev/null +++ b/src/pfor/userop.h @@ -0,0 +1,41 @@ +#ifndef PFOR_PFOR_USEROP_H +#define PFOR_PFOR_USEROP_H + +#include "expression/expression.h" + +namespace pfor { + +template +struct UserOperator { + F f; + + template>* = nullptr> + inline decltype(auto) eval(Args&&... args) { + return f(std::forward(args).eval()...); + } + + template + inline decltype(auto) eval(std::size_t i, Args&&... args) { + return f(std::forward(args)[i]...); + } +}; + +/** + * @brief make an operator from a function + * + * @param[in] f a function + * + * @return an operator (UserOperator) + */ +template +auto makeOperator(F&& f) { + return [f = std::forward(f)](auto&&... args) { + using Op = UserOperator; + using Expr = pfor::expr::Expression>...>; + return Expr{{f}, decltype(args)(args)...}; + }; +} + +} + +#endif diff --git a/tests/cluster.cpp b/tests/cluster.cpp new file mode 100644 index 0000000..76eb245 --- /dev/null +++ b/tests/cluster.cpp @@ -0,0 +1,325 @@ +#include +#include "common.h" + +#include +#include +#include + +#define N 10 + +TEST_CASE("Cluster") { + int a_[N], b_[N], c_[N], d_[N], e_[N], f_[N], g_[N]; + + auto a = pfor::Operand(a_); + auto b = pfor::Operand(b_); + auto c = pfor::Operand(c_); + auto d = pfor::Operand(d_); + auto e = pfor::Operand(e_); + auto f = pfor::Operand(f_); + auto g = pfor::Operand(g_); + + using UE0 = decltype(a+b); + using UE1 = decltype(d = b+c); + using UE2 = decltype(e = g); + using UE3 = decltype(b = a); + using UE4 = decltype(f = f+f); + using UE5 = decltype(g = f); + using UE6 = decltype(c = d); + using UE7 = decltype(g = b); + + using E0 = std::decay_t; + using E1 = std::decay_t; + using E2 = std::decay_t; + using E3 = std::decay_t; + using E4 = std::decay_t; + using E5 = std::decay_t; + using E6 = std::decay_t; + + using S0 = pfor::Pack; + using S1 = pfor::Pack; + using S2 = pfor::Pack; + using S3 = pfor::Pack; + using S4 = pfor::Pack; + using S5 = pfor::Pack; + + SECTION("SplitComma") { + TEST(REQUIRE, is_same_v, S0>); + TEST(REQUIRE, is_same_v, S1>); + TEST(REQUIRE, is_same_v, S2>); + TEST(REQUIRE, is_same_v, S3>); + TEST(REQUIRE, is_same_v, S4>); + TEST(REQUIRE, is_same_v, S5>); + } + + SECTION("ReadList") { + using R0 = pfor::Pack; + using R1 = pfor::Pack; + using R2 = pfor::Pack; + using R3 = pfor::Pack; + using R4 = pfor::Pack; + using R5 = pfor::Pack; + + TEST(REQUIRE, is_same_v>, R0>); + TEST(REQUIRE, is_same_v>, R1>); + TEST(REQUIRE, is_same_v>, R2>); + TEST(REQUIRE, is_same_v>, R3>); + TEST(REQUIRE, is_same_v>, R4>); + TEST(REQUIRE, is_same_v>, R5>); + } + + SECTION("WriteList") { + using W0 = pfor::Pack<>; + using W1 = pfor::Pack; + using W2 = pfor::Pack; + using W3 = pfor::Pack; + using W4 = pfor::Pack; + using W5 = pfor::Pack; + + TEST(REQUIRE, is_same_v>, W0>); + TEST(REQUIRE, is_same_v>, W1>); + TEST(REQUIRE, is_same_v>, W2>); + TEST(REQUIRE, is_same_v>, W3>); + TEST(REQUIRE, is_same_v>, W4>); + TEST(REQUIRE, is_same_v>, W5>); + } + + SECTION("ComparatorUIntToType") { + TEST(REQUIRE, pfor::ComparatorUIntToType, pfor::UIntToType<1>>::value); + TEST(REQUIRE_FALSE, pfor::ComparatorUIntToType, pfor::UIntToType<0>>::value); + TEST(REQUIRE_FALSE, pfor::ComparatorUIntToType, pfor::UIntToType<0>>::value); + } + + SECTION("ComparatorUIntPack") { + TEST(REQUIRE_FALSE, pfor::ComparatorUIntPack, UIntsToPack<>>::value); + TEST(REQUIRE_FALSE, pfor::ComparatorUIntPack, UIntsToPack<>>::value); + TEST(REQUIRE_FALSE, pfor::ComparatorUIntPack, UIntsToPack<>>::value); + TEST(REQUIRE_FALSE, pfor::ComparatorUIntPack, UIntsToPack<0>>::value); + TEST(REQUIRE_FALSE, pfor::ComparatorUIntPack, UIntsToPack<0, 1, 2>>::value); + TEST(REQUIRE_FALSE, pfor::ComparatorUIntPack, UIntsToPack<0, 1, 2>>::value); + + TEST(REQUIRE, pfor::ComparatorUIntPack, UIntsToPack<1>>::value); + TEST(REQUIRE, pfor::ComparatorUIntPack, UIntsToPack<1>>::value); + TEST(REQUIRE, pfor::ComparatorUIntPack, UIntsToPack<1>>::value); + TEST(REQUIRE, pfor::ComparatorUIntPack, UIntsToPack<1, 3>>::value); + + TEST(REQUIRE, pfor::ComparatorUIntPack, UIntsToPack<1, 3>>::value); + } + + SECTION("ComparatorExpressionInfo") { + using C0 = pfor::Pack, UIntsToPack<>, UIntsToPack<>>; + using C1 = pfor::Pack, UIntsToPack<>, UIntsToPack<>>; + using C2 = pfor::Pack, UIntsToPack<>, UIntsToPack<>>; + + TEST(REQUIRE_FALSE, pfor::ComparatorExpressionInfo::value); + TEST(REQUIRE_FALSE, pfor::ComparatorExpressionInfo::value); + TEST(REQUIRE_FALSE, pfor::ComparatorExpressionInfo::value); + TEST(REQUIRE_FALSE, pfor::ComparatorExpressionInfo::value); + TEST(REQUIRE_FALSE, pfor::ComparatorExpressionInfo::value); + TEST(REQUIRE_FALSE, pfor::ComparatorExpressionInfo::value); + + TEST(REQUIRE, pfor::ComparatorExpressionInfo::value); + TEST(REQUIRE, pfor::ComparatorExpressionInfo::value); + TEST(REQUIRE, pfor::ComparatorExpressionInfo::value); + } + + SECTION("ComparatorWritePack") { + using WP0 = pfor::Pack, UIntsToPack<>, UIntsToPack<>>; + using WP1 = pfor::Pack, UIntsToPack<0>, UIntsToPack<>>; + using WP2 = pfor::Pack, UIntsToPack<1>, UIntsToPack<>>; + using WP3 = pfor::Pack, UIntsToPack<0, 1, 2>, UIntsToPack<>>; + using WP4 = pfor::Pack, UIntsToPack<0, 2>, UIntsToPack<>>; + + TEST(REQUIRE_FALSE, pfor::ComparatorWritePack::value); + TEST(REQUIRE_FALSE, pfor::ComparatorWritePack::value); + TEST(REQUIRE_FALSE, pfor::ComparatorWritePack::value); + TEST(REQUIRE_FALSE, pfor::ComparatorWritePack::value); + TEST(REQUIRE_FALSE, pfor::ComparatorWritePack::value); + TEST(REQUIRE_FALSE, pfor::ComparatorWritePack::value); + + TEST(REQUIRE, pfor::ComparatorWritePack::value); + TEST(REQUIRE, pfor::ComparatorWritePack::value); + TEST(REQUIRE, pfor::ComparatorWritePack::value); + TEST(REQUIRE, pfor::ComparatorWritePack::value); + TEST(REQUIRE, pfor::ComparatorWritePack::value); + TEST(REQUIRE, pfor::ComparatorWritePack::value); + } + + SECTION("ExpressionInfo") { + using EI0 = pfor::Pack, pfor::Pack<>, pfor::Pack>>; + using EI1 = pfor::Pack, pfor::Pack, pfor::Pack>>; + using EI2 = pfor::Pack< + pfor::Pack, pfor::Pack, pfor::Pack>, + pfor::Pack, pfor::Pack, pfor::Pack> + >; + using EI3 = pfor::Pack< + pfor::Pack, pfor::Pack, pfor::Pack>, + pfor::Pack, pfor::Pack, pfor::Pack>, + pfor::Pack, pfor::Pack, pfor::Pack> + >; + + TEST(REQUIRE, is_same_v, EI0>); + TEST(REQUIRE, is_same_v, EI1>); + TEST(REQUIRE, is_same_v, EI2>); + TEST(REQUIRE, is_same_v, EI3>); + } + + SECTION("Clusters") { + using C0 = pfor::Pack<>; + using C1 = pfor::expr::ExpressionInfo; + using C2 = pfor::expr::ExpressionInfo; + using C3 = pfor::expr::ExpressionInfo; + using C4 = pfor::expr::ExpressionInfo; + using C5 = pfor::expr::ExpressionInfo; + + using CC0 = pfor::Pack<>; + using CC1 = pfor::Pack; + using CC2 = pfor::Pack; + using CC3 = pfor::Pack; + using CC4 = pfor::Pack; + using CC5 = pfor::Pack; + + using I0 = pfor::Pack, pfor::Pack<>, pfor::Pack<>>; + using I1 = pfor::Pack, pfor::Pack, pfor::Pack>; + using I2 = pfor::Pack, pfor::Pack, pfor::Pack>; + using I3 = pfor::Pack, pfor::Pack, pfor::Pack>; + + using CC0I1 = pfor::Pack>; + using CC0I2 = pfor::Pack>; + using CC1I1 = pfor::Pack>; + using CC1I2 = pfor::Pack>; + using CC2I1 = pfor::Pack>; + using CC2I2 = pfor::Pack>; + + using F0 = UIntsToPack<>; + using F1 = UIntsToPack<0>; + using F2 = UIntsToPack<0, 1>; + using F3 = UIntsToPack<0, 1, 2>; + using F4 = UIntsToPack<0, 1, 2>; + using F5 = UIntsToPack<0, 1, 2, 3>; + + using CF0 = pfor::Pack<>; + using CF1 = pfor::Pack; + using CF2 = pfor::Pack; + using CF3 = pfor::Pack; + using CF4 = pfor::Pack; + using CF5 = pfor::Pack; + + using CF1I1 = pfor::Pack, UIntsToPack<1>>; + + // using CE0 = pfor::Pack<>; + // using CE1 = UIntsToPack<0>; + // using CE2 = UIntsToPack<0, 1>; + // using CE3 = UIntsToPack<0, 1, 2>; + // using CE4 = UIntsToPack<0, 1, 2>; + // using CE5 = UIntsToPack<0, 1, 2, 3>; + + // using CCE0 = pfor::Pack<>; + // using CCE1 = pfor::Pack; + // using CCE2 = pfor::Pack; + // using CCE3 = pfor::Pack; + // using CCE4 = pfor::Pack; + // using CCE5 = pfor::Pack; + + SECTION("ClusterDepends") { + TEST(REQUIRE_FALSE, pfor::ClusterDepends::value); + TEST(REQUIRE_FALSE, pfor::ClusterDepends::value); + TEST(REQUIRE_FALSE, pfor::ClusterDepends::value); + TEST(REQUIRE_FALSE, pfor::ClusterDepends::value); + + TEST(REQUIRE_FALSE, pfor::ClusterDepends::value); + TEST(REQUIRE_FALSE, pfor::ClusterDepends::value); + TEST(REQUIRE, pfor::ClusterDepends::value); + TEST(REQUIRE_FALSE, pfor::ClusterDepends::value); + + TEST(REQUIRE_FALSE, pfor::ClusterDepends::value); + TEST(REQUIRE, pfor::ClusterDepends::value); + TEST(REQUIRE, pfor::ClusterDepends::value); + TEST(REQUIRE_FALSE, pfor::ClusterDepends::value); + + TEST(REQUIRE_FALSE, pfor::ClusterDepends::value); + TEST(REQUIRE, pfor::ClusterDepends::value); + TEST(REQUIRE, pfor::ClusterDepends::value); + TEST(REQUIRE_FALSE, pfor::ClusterDepends::value); + + TEST(REQUIRE_FALSE, pfor::ClusterDepends::value); + TEST(REQUIRE, pfor::ClusterDepends::value); + TEST(REQUIRE, pfor::ClusterDepends::value); + TEST(REQUIRE, pfor::ClusterDepends::value); + + TEST(REQUIRE_FALSE, pfor::ClusterDepends::value); + TEST(REQUIRE, pfor::ClusterDepends::value); + TEST(REQUIRE, pfor::ClusterDepends::value); + TEST(REQUIRE, pfor::ClusterDepends::value); + } + + SECTION("ClustersInsert") { + TEST(REQUIRE, is_same_v, CC0I1>); + TEST(REQUIRE, is_same_v, CC0I2>); + TEST(REQUIRE, is_same_v, CC1I1>); + TEST(REQUIRE, is_same_v, CC1I2>); + TEST(REQUIRE, is_same_v, CC2I1>); + TEST(REQUIRE, is_same_v, CC2I2>); + } + + SECTION("ClusterExpressionIds") { + TEST(REQUIRE, is_same_v, F0>); + TEST(REQUIRE, is_same_v, F1>); + TEST(REQUIRE, is_same_v, F2>); + TEST(REQUIRE, is_same_v, F3>); + TEST(REQUIRE, is_same_v, F4>); + TEST(REQUIRE, is_same_v, F5>); + } + + SECTION("ClustersExpressionIds") { + TEST(REQUIRE, is_same_v, CF0>); + TEST(REQUIRE, is_same_v, CF1>); + TEST(REQUIRE, is_same_v, CF2>); + TEST(REQUIRE, is_same_v, CF3>); + TEST(REQUIRE, is_same_v, CF4>); + TEST(REQUIRE, is_same_v, CF5>); + + TEST(REQUIRE, is_same_v, CF1I1>); + } + + // SECTION("ClusterExpression") { + // TEST(REQUIRE, is_same_v, CE0>); + // TEST(REQUIRE, is_same_v, CE1>); + // TEST(REQUIRE, is_same_v, CE2>); + // TEST(REQUIRE, is_same_v, CE3>); + // TEST(REQUIRE, is_same_v, CE4>); + // TEST(REQUIRE, is_same_v, CE5>); + // } +// + // SECTION("ClustersExpression") { + // using CCE1I1 = pfor::Pack, UIntsToPack<1>>; +// + // TEST(REQUIRE, is_same_v, CCE0>); + // TEST(REQUIRE, is_same_v, CCE1>); + // TEST(REQUIRE, is_same_v, CCE2>); + // TEST(REQUIRE, is_same_v, CCE3>); + // TEST(REQUIRE, is_same_v, CCE4>); + // TEST(REQUIRE, is_same_v, CCE5>); +// + // TEST(REQUIRE, is_same_v, CCE1I1>); + // } + + SECTION("ClustersGen") { + using CG0 = pfor::Pack>; + using CG1 = pfor::Pack>; + using CG2 = pfor::Pack, UIntsToPack<1>>; + using CG3 = pfor::Pack, UIntsToPack<1>>; + using CG4 = pfor::Pack, UIntsToPack<2>>; + using CG5 = pfor::Pack, UIntsToPack<1>, UIntsToPack<2>>; + using CG6 = pfor::Pack, UIntsToPack<2>, UIntsToPack<4>>; + + TEST(REQUIRE, is_same_v::type, CG0>); + TEST(REQUIRE, is_same_v::type, CG1>); + TEST(REQUIRE, is_same_v::type, CG2>); + TEST(REQUIRE, is_same_v::type, CG3>); + TEST(REQUIRE, is_same_v::type, CG4>); + TEST(REQUIRE, is_same_v::type, CG5>); + + TEST(REQUIRE, is_same_v::type, CG6>); + } + } +} diff --git a/tests/common.h b/tests/common.h new file mode 100644 index 0000000..28b4037 --- /dev/null +++ b/tests/common.h @@ -0,0 +1,30 @@ +#ifndef CATCH_COMMON_H +#define CATCH_COMMON_H + +#include +#include +#include + +#define TEST(T, ...) do { \ + decltype(__VA_ARGS__) r_ = __VA_ARGS__; \ + T(r_); \ + } while(false) + +#define TEST_IF(T, O, R, ...) do { \ + decltype(__VA_ARGS__) r_ = __VA_ARGS__; \ + T(r_ O R); \ + } while(false) + +#define V(T) std::declval() + +template +constexpr bool is_same_v = std::is_same::value; + +template +using UIntsToPack = pfor::Pack...>; + +template +constexpr auto _ = pfor::ctv; + + +#endif diff --git a/tests/expression/algorithm.cpp b/tests/expression/algorithm.cpp new file mode 100644 index 0000000..7bf0b68 --- /dev/null +++ b/tests/expression/algorithm.cpp @@ -0,0 +1,77 @@ +#include +#include "../common.h" + +#include + +TEST_CASE("Operand Utilities") { + constexpr pfor::expr::Access r = pfor::expr::Access::read, w = pfor::expr::Access::write; + + SECTION("WorstAccess") { + TEST_IF(REQUIRE, ==, r, pfor::expr::WorstAccess::value); + TEST_IF(REQUIRE, ==, w, pfor::expr::WorstAccess::value); + TEST_IF(REQUIRE, ==, w, pfor::expr::WorstAccess::value); + TEST_IF(REQUIRE, ==, w, pfor::expr::WorstAccess::value); + TEST_IF(REQUIRE, ==, w, pfor::expr::WorstAccess::value); + } + + SECTION("Tags") { + using Iterator = void; + + using T1R = pfor::expr::OperandTag; + using T2R = pfor::expr::OperandTag; + using T3R = pfor::expr::OperandTag; + using T1W = pfor::expr::OperandTag; + using T2W = pfor::expr::OperandTag; + using T3W = pfor::expr::OperandTag; + + using I0 = pfor::Pack<>; + using I1 = pfor::Pack; + using I2 = pfor::Pack; + using I3 = pfor::Pack; + + SECTION("CountWrite") { + using R = pfor::expr::OperandTag; + using W = pfor::expr::OperandTag; + + TEST_IF(REQUIRE, ==, 0, pfor::expr::CountWrite>::value); + TEST_IF(REQUIRE, ==, 1, pfor::expr::CountWrite>::value); + TEST_IF(REQUIRE, ==, 2, pfor::expr::CountWrite>::value); + TEST_IF(REQUIRE, ==, 3, pfor::expr::CountWrite>::value); + TEST_IF(REQUIRE, ==, 4, pfor::expr::CountWrite>::value); + } + + SECTION("IncludeTags") { + using O0 = pfor::expr::IncludeTags; + using O1 = pfor::expr::IncludeTags; + using O2 = pfor::expr::IncludeTags; + using O3 = pfor::expr::IncludeTags; + + using E0 = pfor::Pack<>; + using E1 = pfor::Pack; + using E2 = pfor::Pack; + using E3 = pfor::Pack; + + TEST(REQUIRE, is_same_v); + TEST(REQUIRE, is_same_v); + TEST(REQUIRE, is_same_v); + TEST(REQUIRE, is_same_v); + } + + SECTION("ExcludeTags") { + using O0 = pfor::expr::ExcludeTags; + using O1 = pfor::expr::ExcludeTags; + using O2 = pfor::expr::ExcludeTags; + using O3 = pfor::expr::ExcludeTags; + + using E0 = pfor::Pack<>; + using E1 = pfor::Pack; + using E2 = pfor::Pack; + using E3 = pfor::Pack; + + TEST(REQUIRE, is_same_v); + TEST(REQUIRE, is_same_v); + TEST(REQUIRE, is_same_v); + TEST(REQUIRE, is_same_v); + } + } +} diff --git a/tests/expression/expression.cpp b/tests/expression/expression.cpp new file mode 100644 index 0000000..2e94b52 --- /dev/null +++ b/tests/expression/expression.cpp @@ -0,0 +1,305 @@ +#include + +#include +#include +#include + +#define N 5 + +TEST_CASE("Expression") { + int a[]{1000, 2000, 3000, 4000, 5000}, + ca[]{1000, 2000, 3000, 4000, 5000}, + b[]{9, 8, 7, 6, 5}, + *pa[]{a+0, a+1, a+2, a+3, a+4}; + pfor::expr::Expression, pfor::Index> ea{a}; + pfor::expr::Expression, pfor::Index> eb{b}; + pfor::expr::Expression, pfor::Index> epa{pa}; + + SECTION("Expression") { + for(std::size_t i = 0; i < N; ++i) { + REQUIRE(ea[i] == a[i]); + REQUIRE(eb[i] == b[i]); + } + } + + SECTION("Basic operations") { + SECTION("Unary") { + SECTION("PostIncr") { + for(std::size_t i = 0; i < N; ++i) { + REQUIRE((ea++)[i] == (ca[i])); + REQUIRE(a[i] == (ca[i]+1)); + } + } + + SECTION("PostDecr") { + for(std::size_t i = 0; i < N; ++i) { + REQUIRE((ea--)[i] == (ca[i])); + REQUIRE(a[i] == (ca[i]-1)); + } + } + + SECTION("PreIncr") { + for(std::size_t i = 0; i < N; ++i) { + REQUIRE((++ea)[i] == (ca[i]+1)); + REQUIRE(a[i] == (ca[i]+1)); + } + } + + SECTION("PreDecr") { + for(std::size_t i = 0; i < N; ++i) { + REQUIRE((--ea)[i] == (ca[i]-1)); + REQUIRE(a[i] == (ca[i]-1)); + } + } + + SECTION("Plus") { + for(std::size_t i = 0; i < N; ++i) { + REQUIRE((+ea)[i] == (ca[i])); + REQUIRE(a[i] == (ca[i])); + } + } + + SECTION("Minus") { + for(std::size_t i = 0; i < N; ++i) { + REQUIRE((-ea)[i] == (-ca[i])); + REQUIRE(a[i] == (ca[i])); + } + } + + SECTION("Not") { + for(std::size_t i = 0; i < N; ++i) { + REQUIRE((!ea)[i] == (!ca[i])); + REQUIRE(a[i] == (ca[i])); + } + } + + SECTION("BitNot") { + for(std::size_t i = 0; i < N; ++i) { + REQUIRE((~ea)[i] == (~ca[i])); + REQUIRE(a[i] == (ca[i])); + } + } + + SECTION("Indirection") { + for(std::size_t i = 0; i < N; ++i) { + REQUIRE((*epa)[i] == (a[i])); + REQUIRE(a[i] == (ca[i])); + } + } + + SECTION("AddressOf") { + for(std::size_t i = 0; i < N; ++i) { + REQUIRE((&ea)[i] == (a+i)); + REQUIRE(a[i] == (ca[i])); + } + } + } + + SECTION("Binary") { + SECTION("Multiplication") { + for(std::size_t i = 0; i < N; ++i) { + REQUIRE((ea*eb)[i] == (a[i]*b[i])); + REQUIRE(a[i] == (ca[i])); + } + } + + SECTION("Division") { + for(std::size_t i = 0; i < N; ++i) { + REQUIRE((ea/eb)[i] == (a[i]/b[i])); + REQUIRE(a[i] == (ca[i])); + } + } + + SECTION("Modulo") { + for(std::size_t i = 0; i < N; ++i) { + REQUIRE((ea%eb)[i] == (a[i]%b[i])); + REQUIRE(a[i] == (ca[i])); + } + } + + SECTION("Addition") { + for(std::size_t i = 0; i < N; ++i) { + REQUIRE((ea+eb)[i] == (a[i]+b[i])); + REQUIRE(a[i] == (ca[i])); + } + } + + SECTION("Subtraction") { + for(std::size_t i = 0; i < N; ++i) { + REQUIRE((ea-eb)[i] == (a[i]-b[i])); + REQUIRE(a[i] == (ca[i])); + } + } + + SECTION("LeftShift") { + for(std::size_t i = 0; i < N; ++i) { + REQUIRE((ea<>eb)[i] == (a[i]>>b[i])); + REQUIRE(a[i] == (ca[i])); + } + } + + SECTION("Lower") { + for(std::size_t i = 0; i < N; ++i) { + REQUIRE((eaeb)[i] == (a[i]>b[i])); + REQUIRE(a[i] == (ca[i])); + } + } + + SECTION("GreaterEqual") { + for(std::size_t i = 0; i < N; ++i) { + REQUIRE((ea>=eb)[i] == (a[i]>=b[i])); + REQUIRE(a[i] == (ca[i])); + } + } + + SECTION("Equal") { + for(std::size_t i = 0; i < N; ++i) { + REQUIRE((ea==eb)[i] == (a[i]==b[i])); + REQUIRE(a[i] == (ca[i])); + } + } + + SECTION("NotEqual") { + for(std::size_t i = 0; i < N; ++i) { + REQUIRE((ea!=eb)[i] == (a[i]!=b[i])); + REQUIRE(a[i] == (ca[i])); + } + } + + SECTION("BitAnd") { + for(std::size_t i = 0; i < N; ++i) { + REQUIRE((ea&eb)[i] == (a[i]&b[i])); + REQUIRE(a[i] == (ca[i])); + } + } + + SECTION("BitXor") { + for(std::size_t i = 0; i < N; ++i) { + REQUIRE((ea^eb)[i] == (a[i]^b[i])); + REQUIRE(a[i] == (ca[i])); + } + } + + SECTION("BitOr") { + for(std::size_t i = 0; i < N; ++i) { + REQUIRE((ea|eb)[i] == (a[i]|b[i])); + REQUIRE(a[i] == (ca[i])); + } + } + + SECTION("And") { + for(std::size_t i = 0; i < N; ++i) { + REQUIRE((ea&&eb)[i] == (a[i]&&b[i])); + REQUIRE(a[i] == (ca[i])); + } + } + + SECTION("Or") { + for(std::size_t i = 0; i < N; ++i) { + REQUIRE((ea||eb)[i] == (a[i]||b[i])); + REQUIRE(a[i] == (ca[i])); + } + } + + SECTION("Assignments") { + SECTION("Assign") { + for(std::size_t i = 0; i < N; ++i) { + REQUIRE((ea=eb)[i] == (a[i]=b[i])); + REQUIRE(a[i] == b[i]); + } + } + + SECTION("AssignAdd") { + for(std::size_t i = 0; i < N; ++i) { + REQUIRE((ea+=eb)[i] == (a[i]+b[i])); + REQUIRE(a[i] == (ca[i]+b[i])); + } + } + + SECTION("AssignSub") { + for(std::size_t i = 0; i < N; ++i) { + REQUIRE((ea-=eb)[i] == (a[i]-b[i])); + REQUIRE(a[i] == (ca[i]-b[i])); + } + } + + SECTION("AssignMul") { + for(std::size_t i = 0; i < N; ++i) { + REQUIRE((ea*=eb)[i] == (a[i]*b[i])); + REQUIRE(a[i] == (ca[i]*b[i])); + } + } + + SECTION("AssignDiv") { + for(std::size_t i = 0; i < N; ++i) { + REQUIRE((ea/=eb)[i] == (a[i]/b[i])); + REQUIRE(a[i] == (ca[i]/b[i])); + } + } + + SECTION("AssignMod") { + for(std::size_t i = 0; i < N; ++i) { + REQUIRE((ea%=eb)[i] == (a[i]%b[i])); + REQUIRE(a[i] == (ca[i]%b[i])); + } + } + + SECTION("AssignLS") { + for(std::size_t i = 0; i < N; ++i) { + REQUIRE((ea<<=eb)[i] == (a[i]<>=eb)[i] == (a[i]>>b[i])); + REQUIRE(a[i] == (ca[i]>>b[i])); + } + } + + SECTION("AssignAnd") { + for(std::size_t i = 0; i < N; ++i) { + REQUIRE((ea&=eb)[i] == (a[i]&b[i])); + REQUIRE(a[i] == (ca[i]&b[i])); + } + } + + SECTION("AssignXor") { + for(std::size_t i = 0; i < N; ++i) { + REQUIRE((ea^=eb)[i] == (a[i]^b[i])); + REQUIRE(a[i] == (ca[i]^b[i])); + } + } + + SECTION("AssignOr") { + for(std::size_t i = 0; i < N; ++i) { + REQUIRE((ea|=eb)[i] == (a[i]|b[i])); + REQUIRE(a[i] == (ca[i]|b[i])); + } + } + } + } + } +} diff --git a/tests/expression/op.cpp b/tests/expression/op.cpp new file mode 100644 index 0000000..adeb54f --- /dev/null +++ b/tests/expression/op.cpp @@ -0,0 +1,403 @@ +#include + +#include + +template +struct Value { + using IsExpression = pfor::expr::tag::Expression; + + T* ptr; + + Value(T& v): ptr{&v} {} + T& eval() { return *ptr; } +}; + +template +struct Array { + using IsExpression = pfor::expr::tag::Expression; + + T* ptr; + + Array(T* v): ptr{v} {} + T& operator[](std::size_t i) { return ptr[i]; } +}; + +TEST_CASE("operations") { + int a = 240, b = 3; + int *pa = &a, *pb = &b; + int t[5]{100, 200, 300, 400, 500}, u[5]{1, 2, 3, 4, 5}; + int *ps[]{pa, pb}; + + Value va{a}, vb{b}; + Value vpa{pa}, vpb{pb}; + Array at{t}, au{u}; + Array aps{ps}; + + int i3{3}; + Value v3{i3}; + + SECTION("unary operators") { + SECTION("PostIncr") { + int a_{a}, b_{b}, t3{t[3]}; + pfor::expr::op::PostIncr o; + + REQUIRE(o.eval(va) == a_); + REQUIRE(a == a_+1); + + REQUIRE(o.eval(vb) == b_); + REQUIRE(b == b_+1); + + REQUIRE(o.eval(3, at) == t3); + REQUIRE(t[3] == t3+1); + } + + SECTION("PostDecr") { + int a_{a}, b_{b}, t3{t[3]}; + pfor::expr::op::PostDecr o; + + REQUIRE(o.eval(va) == a_); + REQUIRE(a == a_-1); + + REQUIRE(o.eval(vb) == b_); + REQUIRE(b == b_-1); + + REQUIRE(o.eval(3, at) == t3); + REQUIRE(t[3] == t3-1); + } + + SECTION("PreIncr") { + int a_{a}, b_{b}, t3{t[3]}; + pfor::expr::op::PreIncr o; + + REQUIRE(o.eval(va) == a_+1); + REQUIRE(o.eval(vb) == b_+1); + REQUIRE(o.eval(3, at) == t3+1); + } + + SECTION("PreDecr") { + int a_{a}, b_{b}, t3{t[3]}; + pfor::expr::op::PreDecr o; + + REQUIRE(o.eval(va) == a_-1); + REQUIRE(o.eval(vb) == b_-1); + REQUIRE(o.eval(3, at) == t3-1); + } + + SECTION("Plus") { + pfor::expr::op::Plus o; + + REQUIRE(o.eval(va) == a); + REQUIRE(o.eval(vb) == b); + REQUIRE(o.eval(3, at) == t[3]); + } + + SECTION("Minus") { + pfor::expr::op::Minus o; + + REQUIRE(o.eval(va) == -a); + REQUIRE(o.eval(vb) == -b); + REQUIRE(o.eval(3, at) == -t[3]); + } + + SECTION("Not") { + pfor::expr::op::Not o; + + REQUIRE_FALSE(o.eval(va)); + REQUIRE_FALSE(o.eval(vb)); + REQUIRE_FALSE(o.eval(3, at)); + } + + SECTION("BitNot") { + pfor::expr::op::BitNot o; + + REQUIRE(o.eval(va) == ~a); + REQUIRE(o.eval(vb) == ~b); + REQUIRE(o.eval(3, at) == ~t[3]); + } + + SECTION("Indirection") { + pfor::expr::op::Indirection o; + + REQUIRE(o.eval(vpa) == a); + REQUIRE(o.eval(1, aps) == b); + } + + SECTION("AddressOf") { + pfor::expr::op::AddressOf o; + + REQUIRE(o.eval(va) == &a); + REQUIRE(o.eval(3, at) == t+3); + } + } + + SECTION("binary operators") { + SECTION("PtrToMem") { + struct Foo { + int bar = 42; + } foo; + + Value vm{&Foo::bar}; + Value vf{&foo}; + + decltype(&Foo::bar) const tm[]{&Foo::bar}; + Foo*const tf[]{&foo}; + Array am{tm}; + Array af{tf}; + + pfor::expr::op::PtrToMem o; + + // TODO fix segfault in release + // REQUIRE(o.eval(vf, vm) == 42); + // REQUIRE(o.eval(0, af, am) == 42); + } + + SECTION("Multiplication") { + pfor::expr::op::Multiplication o; + + REQUIRE(o.eval(va, vb) == a*b); + REQUIRE(o.eval(3, at, au) == t[3]*u[3]); + } + + SECTION("Division") { + pfor::expr::op::Division o; + + REQUIRE(o.eval(va, vb) == a/b); + REQUIRE(o.eval(3, at, au) == t[3]/u[3]); + } + + SECTION("Modulo") { + pfor::expr::op::Modulo o; + + REQUIRE(o.eval(va, vb) == a%b); + REQUIRE(o.eval(3, at, au) == t[3]%u[3]); + } + + SECTION("Addition") { + pfor::expr::op::Addition o; + + REQUIRE(o.eval(va, vb) == a+b); + REQUIRE(o.eval(3, at, au) == t[3]+u[3]); + } + + SECTION("Subtraction") { + pfor::expr::op::Subtraction o; + + REQUIRE(o.eval(va, vb) == a-b); + REQUIRE(o.eval(3, at, au) == t[3]-u[3]); + } + + SECTION("LeftShift") { + pfor::expr::op::LeftShift o; + + REQUIRE(o.eval(va, vb) == a<>b); + REQUIRE(o.eval(3, at, au) == t[3]>>u[3]); + } + + SECTION("Lower") { + pfor::expr::op::Lower o; + + REQUIRE(o.eval(va, vb) == ab); + REQUIRE(o.eval(3, at, au) == t[3]>u[3]); + } + + SECTION("GreaterEqual") { + pfor::expr::op::GreaterEqual o; + + REQUIRE(o.eval(va, vb) == a>=b); + REQUIRE(o.eval(3, at, au) == t[3]>=u[3]); + } + + SECTION("Equal") { + pfor::expr::op::Equal o; + + REQUIRE(o.eval(va, vb) == (a==b)); + REQUIRE(o.eval(3, at, au) == (t[3]==u[3])); + } + + SECTION("NotEqual") { + pfor::expr::op::NotEqual o; + + REQUIRE(o.eval(va, vb) == (a!=b)); + REQUIRE(o.eval(3, at, au) == (t[3]!=u[3])); + } + + SECTION("BitAnd") { + pfor::expr::op::BitAnd o; + + REQUIRE(o.eval(va, vb) == (a&b)); + REQUIRE(o.eval(3, at, au) == (t[3]&u[3])); + } + + SECTION("BitXor") { + pfor::expr::op::BitXor o; + + REQUIRE(o.eval(va, vb) == (a^b)); + REQUIRE(o.eval(3, at, au) == (t[3]^u[3])); + } + + SECTION("BitOr") { + pfor::expr::op::BitOr o; + + REQUIRE(o.eval(va, vb) == (a|b)); + REQUIRE(o.eval(3, at, au) == (t[3]|u[3])); + } + + SECTION("And") { + pfor::expr::op::And o; + + REQUIRE(o.eval(va, vb) == (a&&b)); + REQUIRE(o.eval(3, at, au) == (t[3]&&u[3])); + } + + SECTION("Or") { + pfor::expr::op::Or o; + + REQUIRE(o.eval(va, vb) == (a||b)); + REQUIRE(o.eval(3, at, au) == (t[3]||u[3])); + } + + SECTION("Assign") { + pfor::expr::op::Assign o; + + REQUIRE(o.eval(va, vb) == (a=b)); + REQUIRE(o.eval(3, at, au) == (t[3]=u[3])); + } + + SECTION("AssignAdd") { + pfor::expr::op::AssignAdd o; + + REQUIRE(o.eval(va, vb) == (a+=b)); + REQUIRE(o.eval(3, at, au) == (t[3]+=u[3])); + } + + SECTION("AssignSub") { + pfor::expr::op::AssignSub o; + + REQUIRE(o.eval(va, vb) == (a-=b)); + REQUIRE(o.eval(3, at, au) == (t[3]-=u[3])); + } + + SECTION("AssignMul") { + pfor::expr::op::AssignMul o; + + REQUIRE(o.eval(va, vb) == (a*=b)); + REQUIRE(o.eval(3, at, au) == (t[3]*=u[3])); + } + + SECTION("AssignDiv") { + pfor::expr::op::AssignDiv o; + + REQUIRE(o.eval(va, vb) == (a/=b)); + REQUIRE(o.eval(3, at, au) == (t[3]/=u[3])); + } + + SECTION("AssignMod") { + pfor::expr::op::AssignMod o; + + REQUIRE(o.eval(va, vb) == (a%=b)); + REQUIRE(o.eval(3, at, au) == (t[3]%=u[3])); + } + + SECTION("AssignLS") { + pfor::expr::op::AssignLS o; + + REQUIRE(o.eval(va, vb) == (a<<=b)); + REQUIRE(o.eval(3, at, au) == (t[3]<<=u[3])); + } + + SECTION("AssignRS") { + pfor::expr::op::AssignRS o; + + REQUIRE(o.eval(va, vb) == (a>>=b)); + REQUIRE(o.eval(3, at, au) == (t[3]>>=u[3])); + } + + SECTION("AssignAnd") { + pfor::expr::op::AssignAnd o; + + REQUIRE(o.eval(va, vb) == (a&=b)); + REQUIRE(o.eval(3, at, au) == (t[3]&=u[3])); + } + + SECTION("AssignXor") { + pfor::expr::op::AssignXor o; + + REQUIRE(o.eval(va, vb) == (a^=b)); + REQUIRE(o.eval(3, at, au) == (t[3]^=u[3])); + } + + SECTION("AssignOr") { + pfor::expr::op::AssignOr o; + + REQUIRE(o.eval(va, vb) == (a|=b)); + REQUIRE(o.eval(3, at, au) == (t[3]|=u[3])); + } + + SECTION("Comma") { + pfor::expr::op::Comma o; + + REQUIRE(o.eval(va, vb) == b); + REQUIRE(o.eval(3, at, au) == au[3]); + + REQUIRE(o.eval(va, va, vb) == b); + REQUIRE(o.eval(3, at, at, au) == au[3]); + } + } + + SECTION("If") { + pfor::expr::op::If o; + + REQUIRE(o.eval(va, va, vb) == a); + REQUIRE(o.eval(3, at, at, au) == t[3]); + } + + SECTION("FunctionCall") { + auto f1 = []{ return 42; }; + auto f2 = [](int i, int j) { return std::to_string(i/2+j); }; + + decltype(f2) tf2[]{f2}; + Array atf2{tf2}; + + pfor::expr::op::FunctionCall o; + + REQUIRE(o.eval(Value{f1}) == 42); + REQUIRE(o.eval(0, atf2, at, au) == "51"); + } + + SECTION("Subscript") { + pfor::expr::op::Subscript o; + + int i{1}; + int id[]{1, 0}; + int a[]{3, 2, 1, 0}; + int a2[][2]{{3, 2}, {1, 4}}; + Value vi{i}; + Value va{a}; + Array ai{id}; + Array aa{a2}; + + REQUIRE(o.eval(va, vi) == a[i]); + REQUIRE(o.eval(1, aa, ai) == a2[1][id[1]]); + } +} diff --git a/tests/expression/tagger.cpp b/tests/expression/tagger.cpp new file mode 100644 index 0000000..1f6be60 --- /dev/null +++ b/tests/expression/tagger.cpp @@ -0,0 +1,132 @@ +#include +#include "../common.h" + +#include +#include + +TEST_CASE("ExpressionTagger") { + constexpr pfor::expr::Access R = pfor::expr::Access::read, W = pfor::expr::Access::write; + + using O1 = pfor::expr::Expression; + using O2 = pfor::expr::Expression; + using O3 = pfor::expr::Expression; + + using OT1R = pfor::expr::OperandTag; + using OT2R = pfor::expr::OperandTag; + using OT3R = pfor::expr::OperandTag; + using OT1W = pfor::expr::OperandTag; + using OT2W = pfor::expr::OperandTag; + using OT3W = pfor::expr::OperandTag; + + using Tags1R = pfor::Pack; + using Tags1R2R = pfor::Pack; + using Tags1R2R3R = pfor::Pack; + using Tags1W2R = pfor::Pack; + using Tags1W1R2R = pfor::Pack; + using Tags1W1R2R3R = pfor::Pack; + using Tags1W2W3R3R = pfor::Pack; + using Tags1R2W3W3R = pfor::Pack; + using Tags1R2W3R3R = pfor::Pack; + + using EPlus = decltype(+V(O1)); + using EMinus = decltype(-V(O1)); + using ENot = decltype(!V(O1)); + using EBitNot = decltype(~V(O1)); + using EIndirection = decltype(*V(O1)); + using EAddressOf = decltype(&V(O1)); + + using EMultiplication = decltype(V(O1) * V(O2)); + using EDivision = decltype(V(O1) / V(O2)); + using EModulo = decltype(V(O1) % V(O2)); + using EAddition = decltype(V(O1) + V(O2)); + using ESubtraction = decltype(V(O1) - V(O2)); + using ELeftShift = decltype(V(O1) << V(O2)); + using ERightShift = decltype(V(O1) >> V(O2)); + using ELower = decltype(V(O1) < V(O2)); + using ELowerEqual = decltype(V(O1) <= V(O2)); + using EGreater = decltype(V(O1) > V(O2)); + using EGreaterEqual = decltype(V(O1) >= V(O2)); + using EEqual = decltype(V(O1) == V(O2)); + using ENotEqual = decltype(V(O1) != V(O2)); + using EBitAnd = decltype(V(O1) & V(O2)); + using EBitXor = decltype(V(O1) ^ V(O2)); + using EBitOr = decltype(V(O1) | V(O2)); + using EAnd = decltype(V(O1) && V(O2)); + using EOr = decltype(V(O1) || V(O2)); + + using EAssign = decltype(V(O1) = V(O2)); + using EAssignAdd = decltype(V(O1) += V(O2)); + using EAssignSub = decltype(V(O1) -= V(O2)); + using EAssignMul = decltype(V(O1) *= V(O2)); + using EAssignDiv = decltype(V(O1) /= V(O2)); + using EAssignMod = decltype(V(O1) %= V(O2)); + using EAssignLS = decltype(V(O1) <<= V(O2)); + using EAssignRS = decltype(V(O1) >>= V(O2)); + using EAssignAnd = decltype(V(O1) &= V(O2)); + using EAssignXor = decltype(V(O1) ^= V(O2)); + using EAssignOr = decltype(V(O1) |= V(O2)); + + using E1Assign1Add = decltype(V(O1) = V(O1) + V(O2)); + using E1Assign2Add = decltype(V(O1) = V(O1) + V(O2) + V(O3)); + using E2Assign1Add = decltype(V(O1) = V(O2) = V(O3) + V(O3)); + + using EIf = decltype(If(V(O1), V(O2), V(O3))); + using EIfAssign = decltype(If(V(O1), V(O2), V(O3)) = V(O3)); + using EIfInAssign = decltype(If(V(O1), V(O2) = V(O3), V(O3))); + + SECTION("ExpressionTagger") { + SECTION("Unary operations") { + TEST(REQUIRE, is_same_v, Tags1R>); + TEST(REQUIRE, is_same_v, Tags1R>); + TEST(REQUIRE, is_same_v, Tags1R>); + TEST(REQUIRE, is_same_v, Tags1R>); + TEST(REQUIRE, is_same_v, Tags1R>); + TEST(REQUIRE, is_same_v, Tags1R>); + } + + SECTION("Binary operations") { + TEST(REQUIRE, is_same_v, Tags1R2R>); + TEST(REQUIRE, is_same_v, Tags1R2R>); + TEST(REQUIRE, is_same_v, Tags1R2R>); + TEST(REQUIRE, is_same_v, Tags1R2R>); + TEST(REQUIRE, is_same_v, Tags1R2R>); + TEST(REQUIRE, is_same_v, Tags1R2R>); + TEST(REQUIRE, is_same_v, Tags1R2R>); + TEST(REQUIRE, is_same_v, Tags1R2R>); + TEST(REQUIRE, is_same_v, Tags1R2R>); + TEST(REQUIRE, is_same_v, Tags1R2R>); + TEST(REQUIRE, is_same_v, Tags1R2R>); + TEST(REQUIRE, is_same_v, Tags1R2R>); + TEST(REQUIRE, is_same_v, Tags1R2R>); + TEST(REQUIRE, is_same_v, Tags1R2R>); + TEST(REQUIRE, is_same_v, Tags1R2R>); + TEST(REQUIRE, is_same_v, Tags1R2R>); + TEST(REQUIRE, is_same_v, Tags1R2R>); + TEST(REQUIRE, is_same_v, Tags1R2R>); + + TEST(REQUIRE, is_same_v, Tags1W2R>); + TEST(REQUIRE, is_same_v, Tags1W2R>); + TEST(REQUIRE, is_same_v, Tags1W2R>); + TEST(REQUIRE, is_same_v, Tags1W2R>); + TEST(REQUIRE, is_same_v, Tags1W2R>); + TEST(REQUIRE, is_same_v, Tags1W2R>); + TEST(REQUIRE, is_same_v, Tags1W2R>); + TEST(REQUIRE, is_same_v, Tags1W2R>); + TEST(REQUIRE, is_same_v, Tags1W2R>); + TEST(REQUIRE, is_same_v, Tags1W2R>); + TEST(REQUIRE, is_same_v, Tags1W2R>); + } + + SECTION("If") { + TEST(REQUIRE, is_same_v, Tags1R2R3R>); + TEST(REQUIRE, is_same_v, Tags1R2W3W3R>); + TEST(REQUIRE, is_same_v, Tags1R2W3R3R>); + } + + SECTION("Multiple operations") { + TEST(REQUIRE, is_same_v, Tags1W1R2R>); + TEST(REQUIRE, is_same_v, Tags1W1R2R3R>); + TEST(REQUIRE, is_same_v, Tags1W2W3R3R>); + } + } +} diff --git a/tests/expression/traits.cpp b/tests/expression/traits.cpp new file mode 100644 index 0000000..32a682a --- /dev/null +++ b/tests/expression/traits.cpp @@ -0,0 +1,33 @@ +#include +#include "../common.h" + +#include + +TEST_CASE("Expression/Traits") { + struct E { using IsExpression = pfor::expr::tag::Expression; } e; + struct F {} f; + + SECTION("IsExpression") { + REQUIRE(pfor::expr::IsExpression::value); + REQUIRE_FALSE(pfor::expr::IsExpression::value); + + REQUIRE(pfor::expr::IsExpression::value); + REQUIRE_FALSE(pfor::expr::IsExpression::value); + } + + SECTION("AllExpression") { + TEST(REQUIRE, pfor::expr::AllExpression::value); + TEST(REQUIRE_FALSE, pfor::expr::AllExpression::value); + TEST(REQUIRE_FALSE, pfor::expr::AllExpression::value); + TEST(REQUIRE_FALSE, pfor::expr::AllExpression::value); + TEST(REQUIRE_FALSE, pfor::expr::AllExpression::value); + } + + SECTION("AnyExpression") { + TEST(REQUIRE, pfor::expr::AnyExpression::value); + TEST(REQUIRE, pfor::expr::AnyExpression::value); + TEST(REQUIRE, pfor::expr::AnyExpression::value); + TEST(REQUIRE, pfor::expr::AnyExpression::value); + TEST(REQUIRE_FALSE, pfor::expr::AnyExpression::value); + } +} diff --git a/tests/index/index.cpp b/tests/index/index.cpp new file mode 100644 index 0000000..7edd039 --- /dev/null +++ b/tests/index/index.cpp @@ -0,0 +1,68 @@ +#include + +#include +#include + +TEST_CASE("Index") { + pfor::Index it; + pfor::index::Index<3> c3; + + std::size_t i = 5; + + SECTION("Index") { + REQUIRE(it.eval(i) == i); + } + + SECTION("Basic operations") { + SECTION("Plus") { + REQUIRE((+it).eval(i) == i); + } + + SECTION("Minus") { + REQUIRE((-it).eval(i) == -i); + } + + // SECTION("Not") { + // REQUIRE((!it).eval(i) == !i); + // } + + // SECTION("BitNot") { + // REQUIRE((~it).eval(i) == ~i); + // } + + SECTION("Addition") { + REQUIRE((it+c3).eval(i) == i+3); + REQUIRE((it+it).eval(i) == i+i); + } + + SECTION("Subtraction") { + REQUIRE((it-c3).eval(i) == i-3); + REQUIRE((it-it).eval(i) == 0); + } + + SECTION("Multiplication") { + REQUIRE((it*c3).eval(i) == i*3); + REQUIRE((it*it).eval(i) == i*i); + } + + // SECTION("Division") { + // REQUIRE((it/c3).eval(i) == i/3); + // REQUIRE((it/it).eval(i) == 1); + // } + + // SECTION("Modulo") { + // REQUIRE((it%c3).eval(i) == i%3); + // REQUIRE((it%it).eval(i) == 0); + // } + + // SECTION("LeftShift") { + // REQUIRE((it<>c3).eval(i) == i>>3); + // REQUIRE((it>>it).eval(i) == i>>i); + // } + } +} diff --git a/tests/index/traits.cpp b/tests/index/traits.cpp new file mode 100644 index 0000000..1e91192 --- /dev/null +++ b/tests/index/traits.cpp @@ -0,0 +1,75 @@ +#include +#include "../common.h" + +#include +#include + +TEST_CASE("Index/Traits") { + pfor::Index it; + pfor::index::Index<2> c2; + pfor::index::Index<3> c3; + pfor::index::Index<4> c4; + pfor::index::Index<5> c5; + + std::size_t i = 5; + + using C2 = decltype(c2); + using C3 = decltype(c3); + using C4 = decltype(c4); + using C5 = decltype(c5); + + using E0 = decltype(it); + using E1 = decltype(it+c3); + using E2 = decltype(it*c3); + using E3 = decltype(it*c3+c5); + using E4 = decltype((it+c3)*c5); + using E5 = decltype(((it+c3)*c5+c4)*c2); + using E6 = decltype(((it+it)+c3)+(c2*it+c5)); + using E7 = decltype(((c2+c3)*c4)*(it+c5)); + + using F1 = decltype(it*it); + using F2 = decltype((it+c3)*(it+c2)); + using F3 = decltype((it*it+c3)*(c2+it*it)); + + SECTION("IsConstant") { + REQUIRE(pfor::index::isConstant); + REQUIRE(pfor::index::isConstant); + REQUIRE(pfor::index::isConstant); + REQUIRE(pfor::index::isConstant); + + REQUIRE_FALSE(pfor::index::isConstant); + REQUIRE_FALSE(pfor::index::isConstant); + REQUIRE_FALSE(pfor::index::isConstant); + REQUIRE_FALSE(pfor::index::isConstant); + REQUIRE_FALSE(pfor::index::isConstant); + REQUIRE_FALSE(pfor::index::isConstant); + REQUIRE_FALSE(pfor::index::isConstant); + REQUIRE_FALSE(pfor::index::isConstant); + } + + SECTION("IsLinear") { + REQUIRE(pfor::index::isLinear); + REQUIRE(pfor::index::isLinear); + REQUIRE(pfor::index::isLinear); + REQUIRE(pfor::index::isLinear); + + REQUIRE(pfor::index::isLinear); + REQUIRE(pfor::index::isLinear); + REQUIRE(pfor::index::isLinear); + REQUIRE(pfor::index::isLinear); + REQUIRE(pfor::index::isLinear); + REQUIRE(pfor::index::isLinear); + REQUIRE(pfor::index::isLinear); + REQUIRE(pfor::index::isLinear); + + REQUIRE_FALSE(pfor::index::isLinear); + REQUIRE_FALSE(pfor::index::isLinear); + REQUIRE_FALSE(pfor::index::isLinear); + } + + SECTION("AllLinear") { + TEST(REQUIRE, pfor::index::allLinear); + TEST(REQUIRE, pfor::index::allLinear); + TEST(REQUIRE_FALSE, pfor::index::allLinear); + } +} diff --git a/tests/internal/rwcontrol.cpp b/tests/internal/rwcontrol.cpp new file mode 100644 index 0000000..c605cc9 --- /dev/null +++ b/tests/internal/rwcontrol.cpp @@ -0,0 +1,88 @@ +#include +#include "../common.h" + +#include +#include + +TEST_CASE("RWControl") { + constexpr pfor::expr::Access R = pfor::expr::Access::read, W = pfor::expr::Access::write; + + pfor::Index it; + + using OT1R = pfor::expr::OperandTag; + using OT2R = pfor::expr::OperandTag; + using OT3R = pfor::expr::OperandTag; + using OT1W = pfor::expr::OperandTag; + using OT2W = pfor::expr::OperandTag; + using OT3W = pfor::expr::OperandTag; + + using Tags1R = pfor::Pack; + using Tags1R2R = pfor::Pack; + using Tags1R2R3R = pfor::Pack; + using Tags1W2R = pfor::Pack; + using Tags1W1R2R = pfor::Pack; + using Tags1W1R2R3R = pfor::Pack; + using Tags1W2W3R3R = pfor::Pack; + using Tags1R2W3W3R = pfor::Pack; + using Tags1R2W3R3R = pfor::Pack; + + SECTION("RWControl") { + SECTION("Constant index") { + using C0 = decltype(pfor::ctv<0>); + + using TagsW = pfor::Pack>; + using TagsR = pfor::Pack>; + using TagsRW = pfor::Pack, pfor::expr::OperandTag>; + + REQUIRE_FALSE(pfor::rwControl); + REQUIRE(pfor::rwControl); + REQUIRE_FALSE(pfor::rwControl); + } + + SECTION("Same index") { + REQUIRE(pfor::rwControl); + REQUIRE(pfor::rwControl); + REQUIRE(pfor::rwControl); + REQUIRE(pfor::rwControl); + REQUIRE(pfor::rwControl); + REQUIRE(pfor::rwControl); + REQUIRE(pfor::rwControl); + REQUIRE(pfor::rwControl); + REQUIRE(pfor::rwControl); + REQUIRE(pfor::rwControl); + } + + SECTION("Different indices") { + using OT1RI = pfor::expr::OperandTag*it)>; + using OT2RI = pfor::expr::OperandTag*it)>; + using OT3RI = pfor::expr::OperandTag*it)>; + using OT1WI = pfor::expr::OperandTag*it+pfor::ctv<1>)>; + using OT2WI = pfor::expr::OperandTag*it+pfor::ctv<1>)>; + using OT3WI = pfor::expr::OperandTag*it+pfor::ctv<1>)>; + + using Tags1 = pfor::Pack; + using Tags2 = pfor::Pack; + using Tags3 = pfor::Pack; + using Tags4 = pfor::Pack; + + REQUIRE(pfor::rwControl); + REQUIRE_FALSE(pfor::rwControl); + REQUIRE_FALSE(pfor::rwControl); + REQUIRE(pfor::rwControl); + } + + SECTION("Linear Diophantine Cases") { + using LD0 = decltype(pfor::ctv<2>*it); + using LD1 = decltype(it+pfor::ctv<5>); + using LD2 = decltype(pfor::ctv<2>*it+pfor::ctv<5>); + + using Tags0 = pfor::Pack, pfor::expr::OperandTag>; + using Tags1 = pfor::Pack, pfor::expr::OperandTag>; + using Tags2 = pfor::Pack, pfor::expr::OperandTag>; + + REQUIRE_FALSE(pfor::rwControl); + REQUIRE(pfor::rwControl); + REQUIRE_FALSE(pfor::rwControl); + } + } +} diff --git a/tests/main.cpp b/tests/main.cpp new file mode 100644 index 0000000..ac5537a --- /dev/null +++ b/tests/main.cpp @@ -0,0 +1,6 @@ +#define CATCH_CONFIG_MAIN +#include + +#include + +std::size_t pfor::ParallelForParameters::nThreads{2}; diff --git a/tests/mp/meta.cpp b/tests/mp/meta.cpp new file mode 100644 index 0000000..af27896 --- /dev/null +++ b/tests/mp/meta.cpp @@ -0,0 +1,37 @@ +#include +#include "../common.h" + +#include + +template +struct Sizeof { + static constexpr std::size_t value = sizeof(T); +}; + +TEST_CASE("Meta") { + SECTION("If") { + TEST(REQUIRE, is_same_v, int>); + TEST(REQUIRE, is_same_v, char>); + } + + SECTION("accumulate") { + using E = pfor::Pack<>; + using T = pfor::Pack; + + std::size_t esize = pfor::accumulate(0, std::plus{}); + std::size_t tsize = pfor::accumulate(1, std::multiplies{}); + + REQUIRE(esize == 0); + REQUIRE(tsize == sizeof(char)*sizeof(int)*sizeof(float)); + } + + SECTION("GCD") { + pfor::IntToType a; // ensure gcd can be computed at compile-time + + REQUIRE(pfor::gcd(5, 0) == 5); + REQUIRE(pfor::gcd(9, 0) == 9); + REQUIRE(pfor::gcd(-21, 9) == 3); + REQUIRE(pfor::gcd(2*3*7*11*17, 11*19*23) == 11); + REQUIRE(pfor::gcd(2*3*7*11*17*23, -11*19*23) == 11*23); + } +} diff --git a/tests/mp/pack.cpp b/tests/mp/pack.cpp new file mode 100644 index 0000000..0fd6a0f --- /dev/null +++ b/tests/mp/pack.cpp @@ -0,0 +1,150 @@ +#include +#include "../common.h" + +#include +#include + +template struct Comparator; +template +struct Comparator, pfor::UIntToType> { + static constexpr bool value = A < B; +}; + +template +using TSBefore = pfor::impl::PackSortBefore>; + +template +using TSAfter = pfor::impl::PackSortAfter>; + +template +using TSInsert = pfor::PackSortInsert>; + +template +using TSort = pfor::PackSort; + +TEST_CASE("Pack") { + using T1 = pfor::Pack<>; + using T2 = pfor::Pack; + using T3 = pfor::Pack; + using T4 = pfor::Pack; + using T5 = pfor::Pack; + using U3 = pfor::Pack; + using U4 = pfor::Pack; + using U5 = pfor::Pack; + + using M0 = pfor::Pack<>; + using M1 = pfor::Pack; + using M2 = pfor::Pack; + using M3 = pfor::Pack; + using M4 = pfor::Pack; + + SECTION("PackGet") { + TEST(REQUIRE, is_same_v, char>); + TEST(REQUIRE, is_same_v, char>); + TEST(REQUIRE, is_same_v, char>); + TEST(REQUIRE, is_same_v, char>); + TEST(REQUIRE, is_same_v, char>); + TEST(REQUIRE, is_same_v, int>); + TEST(REQUIRE, is_same_v, char>); + TEST(REQUIRE, is_same_v, int>); + TEST(REQUIRE, is_same_v, char>); + TEST(REQUIRE, is_same_v, float>); + TEST(REQUIRE, is_same_v, int>); + TEST(REQUIRE, is_same_v, char>); + } + + SECTION("PackAppend") { + TEST(REQUIRE, is_same_v, T2>); + TEST(REQUIRE, is_same_v, T3>); + TEST(REQUIRE, is_same_v, T4>); + } + + SECTION("PackPrepend") { + TEST(REQUIRE, is_same_v, U3>); + TEST(REQUIRE, is_same_v, U4>); + TEST(REQUIRE, is_same_v, U5>); + } + + SECTION("PackRemove") { + TEST(REQUIRE, is_same_v, T3>); + TEST(REQUIRE, is_same_v, pfor::Pack>); + TEST(REQUIRE, is_same_v, T5>); + } + + SECTION("PackContains") { + TEST(REQUIRE_FALSE, pfor::packContains); + TEST(REQUIRE, pfor::packContains); + TEST(REQUIRE_FALSE, pfor::packContains); + TEST(REQUIRE, pfor::packContains); + TEST(REQUIRE_FALSE, pfor::packContains); + TEST(REQUIRE, pfor::packContains); + } + + SECTION("PackUniq") { + using U1 = pfor::Pack<>; + using U2 = pfor::Pack; + using U3 = pfor::Pack; + using U4 = pfor::Pack; + using U5 = pfor::Pack; + + TEST(REQUIRE, is_same_v, U1>); + TEST(REQUIRE, is_same_v, U2>); + TEST(REQUIRE, is_same_v, U3>); + TEST(REQUIRE, is_same_v, U4>); + TEST(REQUIRE, is_same_v, U5>); + } + + SECTION("PackSize") { + TEST_IF(REQUIRE, ==, 0, pfor::packSize); + TEST_IF(REQUIRE, ==, 1, pfor::packSize); + TEST_IF(REQUIRE, ==, 2, pfor::packSize); + TEST_IF(REQUIRE, ==, 3, pfor::packSize); + TEST_IF(REQUIRE, ==, 6, pfor::packSize); + } + + SECTION("PackMerge") { + TEST(REQUIRE, is_same_v, M0>); + TEST(REQUIRE, is_same_v, M0>); + TEST(REQUIRE, is_same_v, M1>); + TEST(REQUIRE, is_same_v, M2>); + TEST(REQUIRE, is_same_v, M3>); + TEST(REQUIRE, is_same_v, M4>); + } + + SECTION("Pack sorting") { + using IT0 = UIntsToPack<>; + using IT1 = UIntsToPack<6, 4, 3, 8, 9, 2, 5, 3>; + + using ST0 = IT0; + using ST1 = UIntsToPack<2, 3, 3, 4, 5, 6, 8, 9>; + using ST2 = UIntsToPack<2, 3, 3, 4, 5, 6, 7, 8, 9>; + using ST3 = UIntsToPack<2, 3, 3, 4, 5, 6, 7, 7, 8, 9>; + + using TEmpty = pfor::Pack<>; + using BT1 = UIntsToPack<2, 3, 3, 4>; + using AT1 = UIntsToPack<5, 6, 8, 9>; + + SECTION("PackSortBefore") { + TEST(REQUIRE, is_same_v, TEmpty>); + TEST(REQUIRE, is_same_v, TEmpty>); + TEST(REQUIRE, is_same_v, BT1>); + } + + SECTION("PackSortAfter") { + TEST(REQUIRE, is_same_v, TEmpty>); + TEST(REQUIRE, is_same_v, TEmpty>); + TEST(REQUIRE, is_same_v, AT1>); + } + + SECTION("PackSortInsert") { + TEST(REQUIRE, is_same_v, UIntsToPack<7>>); + TEST(REQUIRE, is_same_v, ST2>); + TEST(REQUIRE, is_same_v, ST3>); + } + + SECTION("PackSort") { + TEST(REQUIRE, is_same_v, ST0>); + TEST(REQUIRE, is_same_v, ST1>); + } + } +} diff --git a/tests/mp/tuple.cpp b/tests/mp/tuple.cpp new file mode 100644 index 0000000..6c9ef4c --- /dev/null +++ b/tests/mp/tuple.cpp @@ -0,0 +1,41 @@ +#include +#include "../common.h" + +#include + +TEST_CASE("mp/tuple") { + using T0 = std::tuple<>; + using T1 = std::tuple; + using T2 = std::tuple; + using T3 = std::tuple; + using T4 = std::tuple; + using T5 = std::tuple; + using T6 = std::tuple; + + SECTION("SubTuple") { + SECTION("empty") { + TEST(REQUIRE, is_same_v>, T0>); + TEST(REQUIRE, is_same_v>, T0>); + TEST(REQUIRE, is_same_v>, T0>); + TEST(REQUIRE, is_same_v>, T0>); + TEST(REQUIRE, is_same_v>, T0>); + TEST(REQUIRE, is_same_v>, T0>); + TEST(REQUIRE, is_same_v>, T0>); + } + + SECTION("keep all") { + TEST(REQUIRE, is_same_v>, T1>); + TEST(REQUIRE, is_same_v>, T2>); + TEST(REQUIRE, is_same_v>, T3>); + TEST(REQUIRE, is_same_v>, T4>); + TEST(REQUIRE, is_same_v>, T5>); + TEST(REQUIRE, is_same_v>, T6>); + } + + SECTION("general") { + TEST(REQUIRE, is_same_v>, std::tuple>); + TEST(REQUIRE, is_same_v>, std::tuple>); + TEST(REQUIRE, is_same_v>, std::tuple>); + } + } +} diff --git a/tests/parallel_for.cpp b/tests/parallel_for.cpp new file mode 100644 index 0000000..9c5fe41 --- /dev/null +++ b/tests/parallel_for.cpp @@ -0,0 +1,75 @@ +#include +#include "common.h" + +#include + +#include + +#define N 100 + +TEST_CASE("parallelFor") { + int a[N+1], b[N], c[N], d[N], e[N], f[N]; + + std::generate_n(std::begin(a), N+1, [it=0]() mutable { return N-(it++); }); + std::generate_n(std::begin(b), N, [it=0]() mutable { return it++; }); + std::generate_n(std::begin(c), N, []{ return 250; }); + std::generate_n(std::begin(d), N, [it=0]() mutable { return it++&1; }); + std::generate_n(std::begin(e), N, [it=0]() mutable { return it++<<1; }); + std::generate_n(std::begin(f), N, []{ return 0; }); + + SECTION("multiple instructions") { + int ca[N+1], cb[N], cc[N], cd[N], ce[N], cf[N]; + + pfor::Operand oa{a}; + pfor::Operand ob{b}; + pfor::Operand oc{c}; + pfor::Operand od{d}; + pfor::Operand oe{e}; + pfor::Operand of{f}; + + std::copy(std::begin(a), std::end(a), std::begin(ca)); + std::copy(std::begin(b), std::end(b), std::begin(cb)); + std::copy(std::begin(c), std::end(c), std::begin(cc)); + std::copy(std::begin(d), std::end(d), std::begin(cd)); + std::copy(std::begin(e), std::end(e), std::begin(ce)); + std::copy(std::begin(f), std::end(f), std::begin(cf)); + + SECTION("OpenMP") { + pfor::Index i; + pfor::parallelFor(pfor::Range{0, N}, ( + of = oc, + oa[i] = oa[i+_<1>], + ob[i] = ob[i] + 2*oa[i], + oe = oe+oe, + oc = od + )); + + for(std::size_t i = 0; i < N; ++i) { + REQUIRE(f[i] == cc[i]); + REQUIRE(a[i] == ca[i+1]); + REQUIRE(b[i] == (cb[i] + 2*ca[i+1])); + REQUIRE(e[i] == ce[i]+ce[i]); + REQUIRE(c[i] == cd[i]); + } + } + + SECTION("Threads") { + pfor::Index i; + pfor::parallelFor(pfor::Range{0, N}, ( + of = oc, + oa[i] = oa[i+_<1>], + ob[i] = ob[i] + 2*oa[i], + oe = oe+oe, + oc = od + )); + + for(std::size_t i = 0; i < N; ++i) { + REQUIRE(f[i] == cc[i]); + REQUIRE(a[i] == ca[i+1]); + REQUIRE(b[i] == (cb[i] + 2*ca[i+1])); + REQUIRE(e[i] == ce[i]+ce[i]); + REQUIRE(c[i] == cd[i]); + } + } + } +} diff --git a/tests/parallelizable.cpp b/tests/parallelizable.cpp new file mode 100644 index 0000000..f0ee884 --- /dev/null +++ b/tests/parallelizable.cpp @@ -0,0 +1,80 @@ +#include + +#include +#include + +template +constexpr auto _ = pfor::ctv; + +TEST_CASE("Parallelizable") { + using T = std::array; + + T a_; + pfor::Operand a{a_}; + pfor::Index i; + + auto rangeXX = pfor::Range{0,0}; + auto range01 = pfor::RangeCT<0, 1>{0}; + auto range11 = pfor::RangeCT<1, 1>{0}; + auto range02 = pfor::RangeCT<0, 2>{0}; + auto range12 = pfor::RangeCT<1, 2>{0}; + + SECTION("Linear") { + SECTION("Basic") { + auto e = a[_<2>*i+_<1>] = a[_<2>*i]; + + REQUIRE(pfor::parallelTest(rangeXX, e)); + REQUIRE(pfor::parallelTest(range01, e)); + REQUIRE(pfor::parallelTest(range11, e)); + REQUIRE(pfor::parallelTest(range02, e)); + REQUIRE(pfor::parallelTest(range12, e)); + } + SECTION("Requiring step") { + auto e = a[i+_<1>] = a[i]; + + REQUIRE_FALSE(pfor::parallelTest(rangeXX, e)); + REQUIRE_FALSE(pfor::parallelTest(range01, e)); + REQUIRE_FALSE(pfor::parallelTest(range11, e)); + REQUIRE(pfor::parallelTest(range02, e)); + REQUIRE(pfor::parallelTest(range12, e)); + } + SECTION("Requiring begin and step") { + auto e = a[_<2>*i] = a[_<3>*i+_<1>]; + + REQUIRE_FALSE(pfor::parallelTest(rangeXX, e)); + REQUIRE_FALSE(pfor::parallelTest(range01, e)); + REQUIRE_FALSE(pfor::parallelTest(range11, e)); + REQUIRE(pfor::parallelTest(range02, e)); + REQUIRE_FALSE(pfor::parallelTest(range12, e)); + } + } + SECTION("Non linear") { + SECTION("No properties") { + auto e = a[i*i] = a[i*i]+1; + + REQUIRE_FALSE(pfor::parallelTest(rangeXX, e)); + REQUIRE_FALSE(pfor::parallelTest(range01, e)); + REQUIRE_FALSE(pfor::parallelTest(range11, e)); + REQUIRE_FALSE(pfor::parallelTest(range02, e)); + REQUIRE_FALSE(pfor::parallelTest(range12, e)); + } + SECTION("Injective") { + auto e = a[injective(i*i)] = a[injective(i*i)]+1; + + REQUIRE(pfor::parallelTest(rangeXX, e)); + REQUIRE(pfor::parallelTest(range01, e)); + REQUIRE(pfor::parallelTest(range11, e)); + REQUIRE(pfor::parallelTest(range02, e)); + REQUIRE(pfor::parallelTest(range12, e)); + } + SECTION("Strict inc inferred injective") { + auto e = a[strictinc(i*i)] = a[strictinc(i*i)]+1; + + REQUIRE(pfor::parallelTest(rangeXX, e)); + REQUIRE(pfor::parallelTest(range01, e)); + REQUIRE(pfor::parallelTest(range11, e)); + REQUIRE(pfor::parallelTest(range02, e)); + REQUIRE(pfor::parallelTest(range12, e)); + } + } +}

::type; + + +template +decltype(auto) subExpressionImpl(std::tuple& tuple, std::index_sequence) { + return commaMerger(std::get(tuple)...); +} + +template +decltype(auto) subExpression(std::tuple& tuple) { + return subExpressionImpl(tuple, std::make_index_sequence()); +} + +template +decltype(auto) subExpression(std::tuple& tuple) { + return std::get<0>(tuple); +} + +template +decltype(auto) expressionView(Expression& e) { + return Expression, View, Exprs...>{e}; +} + +template +decltype(auto) expressionView(Expression& e) { + return e; +} + +} +} + +#endif diff --git a/src/pfor/expression/tag.h b/src/pfor/expression/tag.h new file mode 100644 index 0000000..b21eefa --- /dev/null +++ b/src/pfor/expression/tag.h @@ -0,0 +1,14 @@ +#ifndef PFOR_PFOR_EXPRESSION_TAG_H +#define PFOR_PFOR_EXPRESSION_TAG_H + +namespace pfor { +namespace expr { +namespace tag { + +struct Expression; + +} +} +} + +#endif diff --git a/src/pfor/expression/tagger.h b/src/pfor/expression/tagger.h new file mode 100644 index 0000000..95e98c2 --- /dev/null +++ b/src/pfor/expression/tagger.h @@ -0,0 +1,72 @@ +#ifndef PFOR_PFOR_EXPRESSION_TAGGER_H +#define PFOR_PFOR_EXPRESSION_TAGGER_H + +#include "access.h" +#include "algorithm.h" +#include "expression.h" +#include "operandtag.h" +#include "op.h" +#include "../mp/pack.h" + +namespace pfor { +namespace expr { + +namespace impl { + +template struct ExpressionTagger; + +template +struct ExpressionTagger { + static constexpr Access faccess = WorstAccess::access>::value; + static constexpr Access taccess = WorstAccess::access>::value; + + using first = typename ExpressionTagger::type; + using type = typename ExpressionTagger::type; +}; + +template +struct ExpressionTagger> { + using type = typename ExpressionTagger::type; +}; + +template +struct ExpressionTagger> { + static constexpr Access waccess = WorstAccess::access>::value; + using type = PackAppend>; +}; + +template +struct ExpressionTagger, Id, Index>> { + static constexpr Access waccess = WorstAccess::access>::value; + using type = PackAppend>; +}; + +template +struct ExpressionTagger> { + static constexpr Access waccess = WorstAccess::access>::value; + using type = PackAppend>>; +}; + +template +struct ExpressionTagger { + using tagcond = typename ExpressionTagger::type; + using tagtrue = typename ExpressionTagger::type; + using type = typename ExpressionTagger::type; +}; + +} + +template struct ExpressionTaggerImpl; + +template +struct ExpressionTaggerImpl> { + using type = typename impl::ExpressionTagger, Access::read, Op, 0, Ts...>::type; +}; + +template +using ExpressionTagger = typename ExpressionTaggerImpl::type; + +} +} + +#endif diff --git a/src/pfor/expression/traits.h b/src/pfor/expression/traits.h new file mode 100644 index 0000000..5372dbe --- /dev/null +++ b/src/pfor/expression/traits.h @@ -0,0 +1,58 @@ +#ifndef PFOR_PFOR_EXPRESSION_TRAITS_H +#define PFOR_PFOR_EXPRESSION_TRAITS_H + +#include + +#include "tag.h" + +namespace pfor { +namespace expr { + +/** + * @brief tests a type and return true if it is an expression + * + * @return true if the type is an expression + */ +template +struct IsExpression: std::false_type {}; + +template +struct IsExpression::IsExpression, tag::Expression>{}>>: std::true_type {}; + +template +constexpr bool isExpression = IsExpression::value; + +/** + * @brief tests a pack of types and returns true is all are expressions + */ +template struct AllExpression: std::false_type {}; + +template +struct AllExpression { + static constexpr bool value = IsExpression::value && AllExpression::value; +}; + +template struct AllExpression: IsExpression {}; + +template +constexpr bool allExpression = AllExpression::value; + +/** + * @brief tests a pack of types and returns true if any of them is an expression + */ +template struct AnyExpression: std::false_type {}; + +template +struct AnyExpression { + static constexpr bool value = IsExpression::value || AnyExpression::value; +}; + +template struct AnyExpression: IsExpression {}; + +template +constexpr bool anyExpression = AnyExpression::value; + +} +} + +#endif diff --git a/src/pfor/expression/tuple.h b/src/pfor/expression/tuple.h new file mode 100644 index 0000000..afeffaf --- /dev/null +++ b/src/pfor/expression/tuple.h @@ -0,0 +1,27 @@ +#ifndef PFOR_PFOR_EXPRESSION_TUPLE_H +#define PFOR_PFOR_EXPRESSION_TUPLE_H + +#include "expression.h" + +namespace pfor { +namespace expr { + +template struct ExpressionsTupleImpl; + +template +struct ExpressionsTupleImpl> { + using type = decltype(std::declval>().operands); +}; + +template +struct ExpressionsTupleImpl { + using type = std::tuple; +}; + +template +using ExpressionsTuple = typename ExpressionsTupleImpl::type; + +} +} + +#endif diff --git a/src/pfor/index/index.h b/src/pfor/index/index.h new file mode 100644 index 0000000..bd22326 --- /dev/null +++ b/src/pfor/index/index.h @@ -0,0 +1,73 @@ +#ifndef PFOR_PFOR_INDEX_INDEX_H +#define PFOR_PFOR_INDEX_INDEX_H + +#include "../mp/meta.h" +#include "../mp/pack.h" +#include "op.h" +#include "tag.h" + +namespace pfor { +namespace index { + +using Value = long; + +/** + * @param first the expression + * @param second a list of properties + */ +template struct IndexImpl; + +template +using IndexImplExpr = IndexImpl, Pack<>>; + +template +struct IndexImpl, P> { + using IsIndex = tag::Index; + using Properties = P; + + inline static Value eval(Value i) { return i; } +}; + +template +struct IndexImpl>, P> { + using IsIndex = tag::Index; + using Properties = P; + + inline static Value eval(Value) { return n; } +}; + +template +struct IndexImpl>, P> { + using IsIndex = tag::Index; + using Index = IndexImpl; + using Properties = P; + + inline static Value eval(Value i) { return Op::eval(Index::eval(i)); } +}; + +template +struct IndexImpl, IndexImpl>, P> { + using IsIndex = tag::Index; + using LIndex = IndexImpl; + using RIndex = IndexImpl; + using Properties = P; + + inline static Value eval(Value i) { return Op::eval(LIndex::eval(i), RIndex::eval(i)); } +}; + +template> +using Index = IndexImpl>, P>; + +} + +template> +using IndexP = index::IndexImpl, P>; + +using Index = IndexP<>; + +template> +constexpr index::Index ctv; + +} + +#endif diff --git a/src/pfor/index/op.h b/src/pfor/index/op.h new file mode 100644 index 0000000..f906def --- /dev/null +++ b/src/pfor/index/op.h @@ -0,0 +1,40 @@ +#ifndef PFOR_PFOR_INDEX_OP_H +#define PFOR_PFOR_INDEX_OP_H + +#include + +#define PFOR_INDEX_DEF_OPERATION_UNARY(OPNAME, OPSYM) \ + struct OPNAME { \ + template \ + inline static decltype(auto) eval(Rhs&& rhs) { \ + return OPSYM std::forward(rhs); \ + } \ + } + +#define PFOR_INDEX_DEF_OPERATION_BINARY(OPNAME, OPSYM) \ + struct OPNAME { \ + template \ + inline static decltype(auto) eval(Lhs&& lhs, Rhs&& rhs) { \ + return std::forward(lhs) OPSYM std::forward(rhs); \ + } \ + } + +namespace pfor { +namespace index { +namespace op { + +PFOR_INDEX_DEF_OPERATION_UNARY(Minus, -); + +PFOR_INDEX_DEF_OPERATION_BINARY(Addition, +); +PFOR_INDEX_DEF_OPERATION_BINARY(Subtraction, -); +PFOR_INDEX_DEF_OPERATION_BINARY(Multiplication, *); +// PFOR_INDEX_DEF_OPERATION_BINARY(Division, /); + +} +} +} + +#undef PFOR_INDEX_DEF_OPERATION_BINARY +#undef PFOR_INDEX_DEF_OPERATION_UNARY + +#endif diff --git a/src/pfor/index/operators.h b/src/pfor/index/operators.h new file mode 100644 index 0000000..882024b --- /dev/null +++ b/src/pfor/index/operators.h @@ -0,0 +1,134 @@ +#ifndef PFOR_PFOR_INDEX_OPERATORS_H +#define PFOR_PFOR_INDEX_OPERATORS_H + +#include "index.h" +#include "op.h" +#include "traits.h" + +#include "properties.h" + +namespace pfor { +namespace index { + +/** + * @brief operator+ + */ +template>* = nullptr> +inline decltype(auto) operator+(Rhs&& rhs) { + return std::forward(rhs); +} + +/** + * @brief operator- + */ +template and not isLinear>>* = nullptr> +inline decltype(auto) operator-(Rhs&&) { + using RhsT = std::decay_t; + using RProp = typename RhsT::Properties; + using Properties = ComputeProperties; + return IndexImpl, Properties>{}; +} + +template and isLinear>>* = nullptr> +inline decltype(auto) operator-(Rhs&&) { + using RhsT = std::decay_t; + return LinearIndex<-linearSlope, -linearOffset>{}; +} + +/** + * @brief operator+ + */ +template< + typename Lhs, typename Rhs, std::enable_if_t< + allIndex and (not isLinear> or not isLinear>) + >* = nullptr +> +inline decltype(auto) operator+(Lhs&&, Rhs&&) { + using LhsT = std::decay_t; + using RhsT = std::decay_t; + using LProp = typename LhsT::Properties; + using RProp = typename RhsT::Properties; + using Properties = ComputeProperties; + return IndexImpl, Properties>{}; +} + +template< + typename Lhs, typename Rhs, std::enable_if_t< + allIndex and (isLinear> and isLinear>) + >* = nullptr +> +inline decltype(auto) operator+(Lhs&&, Rhs&&) { + using LhsT = std::decay_t; + using RhsT = std::decay_t; + return LinearIndex + linearSlope, linearOffset + linearOffset>{}; +} + +/** + * @brief operator- + */ +template< + typename Lhs, typename Rhs, std::enable_if_t< + allIndex and (not isLinear> or not isLinear>) + >* = nullptr +> +inline decltype(auto) operator-(Lhs&&, Rhs&&) { + using LhsT = std::decay_t; + using RhsT = std::decay_t; + using LProp = typename LhsT::Properties; + using RProp = typename RhsT::Properties; + using Properties = ComputeProperties; + return IndexImpl, Properties>{}; +} + +template< + typename Lhs, typename Rhs, std::enable_if_t< + allIndex and (isLinear> and isLinear>) + >* = nullptr +> +inline decltype(auto) operator-(Lhs&&, Rhs&&) { + using LhsT = std::decay_t; + using RhsT = std::decay_t; + return LinearIndex - linearSlope, linearOffset - linearOffset>{}; +} + +/** + * @brief operator* + */ +template< + typename Lhs, typename Rhs, std::enable_if_t< + allIndex and ( + not isLinear> or not isLinear> or + (not isConstant> and not isConstant>) + ) + >* = nullptr +> +inline decltype(auto) operator*(Lhs&&, Rhs&&) { + using LhsT = std::decay_t; + using RhsT = std::decay_t; + using LProp = typename LhsT::Properties; + using RProp = typename RhsT::Properties; + using Properties = ComputeProperties; + return IndexImpl, Properties>{}; +} + +template< + typename Lhs, typename Rhs, std::enable_if_t< + allIndex and ( + isLinear> and isLinear> and + (isConstant> or isConstant>) + ) + >* = nullptr +> +inline decltype(auto) operator*(Lhs&&, Rhs&&) { + using LhsT = std::decay_t; + using RhsT = std::decay_t; + constexpr auto slope = linearSlope + linearSlope; // because one is null + constexpr auto scalar = linearSlope? linearOffset:linearOffset; + constexpr auto offset = linearOffset * linearOffset; + return LinearIndex{}; +} + +} +} + +#endif diff --git a/src/pfor/index/properties.h b/src/pfor/index/properties.h new file mode 100644 index 0000000..dbc2f03 --- /dev/null +++ b/src/pfor/index/properties.h @@ -0,0 +1,10 @@ +#ifndef PFOR_PFOR_INDEX_PROPERTIES_H +#define PFOR_PFOR_INDEX_PROPERTIES_H + +#include "property/injective.h" +#include "property/monotonic.h" +#include "property/linear.h" + +#include "property/traits.h" + +#endif diff --git a/src/pfor/index/property/injective.h b/src/pfor/index/property/injective.h new file mode 100644 index 0000000..50177b6 --- /dev/null +++ b/src/pfor/index/property/injective.h @@ -0,0 +1,48 @@ +#ifndef PFOR_PFOR_INDEX_PROPERTY_INJECTIVE_H +#define PFOR_PFOR_INDEX_PROPERTY_INJECTIVE_H + +#include "../../mp/pack.h" +#include "../index.h" +#include "traits.h" + +namespace pfor { +namespace index { + +namespace prop { + +struct Injective; + +} + +template +struct ComputeProperty { + using type = Pack; +}; + +/** + * @brief tags an index expression as injective + */ +template +auto injective(IndexImpl) { + return IndexImpl>>{}; +} + +/** + * @brief tests if an index has injective property + * + * @param Index an index + * + * @return true if Index is injective + */ +template +struct IsInjective { + static constexpr bool value = hasProperties>; +}; + +template +constexpr bool isInjective = IsInjective::value; + +} +} + +#endif diff --git a/src/pfor/index/property/linear.h b/src/pfor/index/property/linear.h new file mode 100644 index 0000000..ada30eb --- /dev/null +++ b/src/pfor/index/property/linear.h @@ -0,0 +1,206 @@ +#ifndef PFOR_PFOR_INDEX_PROPERTY_LINEAR_H +#define PFOR_PFOR_INDEX_PROPERTY_LINEAR_H + +#include "../../mp/pack.h" +#include "../index.h" +#include "traits.h" + +#include "injective.h" + +namespace pfor { +namespace index { + +namespace prop { + +struct Linear; + +} + +template +struct ComputeProperty { + using type = Pack; +}; + +template +struct ComputeProperty { + using type = If>, Pack, Pack<>>; +}; + +template +struct ComputeProperty { + using type = If>, Pack, Pack<>>; +}; + +template +struct InferProperty { + using type = Pack; +}; + +/** + * @brief tags an index expression as linear + * + * Usually, this is not required as this property is automatically deduced + */ +template +auto linear(IndexImpl) { + return IndexImpl>>{}; +} + +/** + * @brief tests if an index has linear property + * + * @param Index an index + * + * @return true if Index is linear + */ +template +struct IsLinear { + static constexpr bool value = hasProperties>; +}; + +template +struct IsLinear>: std::true_type {}; + +template +struct IsLinear>: std::true_type {}; + +template +struct IsLinear, Index>, P>>: std::true_type {}; + +template +struct IsLinear, Index>, P>>: std::true_type {}; + +template +struct IsLinear< + IndexImpl, Index>, InP>, + Index>, P> +>: std::true_type {}; + +template +constexpr bool isLinear = IsLinear::value; + +/** + */ +template struct LinearSlope; + +template +struct LinearSlope> { + static constexpr Value value = 1; +}; + +template +struct LinearSlope> { + static constexpr Value value = 0; +}; + +template +struct LinearSlope, Index>, P>> { + static constexpr Value value = 1; +}; + +template +struct LinearSlope, Index>, P>> { + static constexpr Value value = a; +}; + +template +struct LinearSlope< + IndexImpl, Index>, InP>, + Index>, P> +> { + static constexpr Value value = a; +}; + +template +constexpr Value linearSlope = LinearSlope::value; + +/** + */ +template struct LinearOffset; + +template +struct LinearOffset> { + static constexpr Value value = 0; +}; + +template +struct LinearOffset> { + static constexpr Value value = b; +}; + +template +struct LinearOffset, Index>, P>> { + static constexpr Value value = b; +}; + +template +struct LinearOffset, Index>, P>> { + static constexpr Value value = 0; +}; + +template +struct LinearOffset< + IndexImpl, Index>, InP>, + Index>, P> +> { + static constexpr Value value = b; +}; + +template +constexpr Value linearOffset = LinearOffset::value; + +/** + */ +template struct AllLinear: std::integral_constant, IsLinear>> {}; + +template +constexpr bool allLinear = AllLinear::value; + +namespace impl { + +using ILinear = AddProperties, Pack>; + +} + +/** + */ +template +struct LinearIndexImpl { + using type = IndexImpl, Index>, Index>, impl::ILinear>; +}; + +template<> +struct LinearIndexImpl<0, 0> { + using type = Index<0, impl::ILinear>; +}; + +template +struct LinearIndexImpl<0, b> { + using type = Index; +}; + +template +struct LinearIndexImpl { + using type = IndexImpl, Index>, impl::ILinear>; +}; + +template +struct LinearIndexImpl<1, b> { + using type = IndexImpl, Index>, impl::ILinear>; +}; + +template<> +struct LinearIndexImpl<1, 0> { + using type = IndexP; +}; + +template +using LinearIndex = typename LinearIndexImpl::type; + +} +} + +#endif diff --git a/src/pfor/index/property/monotonic.h b/src/pfor/index/property/monotonic.h new file mode 100644 index 0000000..9857d65 --- /dev/null +++ b/src/pfor/index/property/monotonic.h @@ -0,0 +1,134 @@ +#ifndef PFOR_PFOR_INDEX_PROPERTY_MONOTONIC_H +#define PFOR_PFOR_INDEX_PROPERTY_MONOTONIC_H + +#include "../../mp/pack.h" +#include "../index.h" +#include "traits.h" + +#include "injective.h" + +namespace pfor { +namespace index { + +namespace prop { + +struct Monotonic; +struct Inc; +struct Dec; +struct Strict; + +using StrictInc = Pack; +using StrictDec = Pack; + +} + +template +struct ComputeProperty { + using type = Pack; +}; + +template +struct ComputeProperty { + using type = Pack; +}; + +template +struct ComputeProperty { + using type = Pack; +}; + +template +struct ComputeProperty { + using type = Pack; +}; + +template +struct ComputeProperty { + using type = If and containsProperties, + prop::StrictInc, + Pack<> + >; +}; + +template +struct ComputeProperty { + using type = If and containsProperties, + prop::StrictDec, + Pack<> + >; +}; + +template +struct ComputeProperty { + using type = If and containsProperties, + prop::StrictInc, + Pack<> + >; +}; + +template +struct ComputeProperty { + using type = If and containsProperties, + prop::StrictDec, + Pack<> + >; +}; + +template +struct InferProperty { + using type = If>, + Pack, + Pack<> + >; +}; + +/** + * @brief tags an index expression as strictly increasing + */ +template +auto strictinc(IndexImpl) { + return IndexImpl>{}; +} + +/** + * @brief tests if an index has strict inc property + * + * @param Index an index + * + * @return true if Index is strictly increasing + */ +template +struct IsStrictInc { + static constexpr bool value = hasProperties; +}; + +template +constexpr bool isStrictInc = IsStrictInc::value; + +/** + * @brief tags an index expression as strictly decreasing + */ +template +auto strictdec(IndexImpl) { + return IndexImpl>{}; +} + +/** + * @brief tests if an index has strict dec property + * + * @param Index an index + * + * @return true if Index is strictly decreasing + */ +template +struct IsStrictDec { + static constexpr bool value = hasProperties; +}; + +template +constexpr bool isStrictDec = IsStrictDec::value; + +} +} + +#endif diff --git a/src/pfor/index/property/traits.h b/src/pfor/index/property/traits.h new file mode 100644 index 0000000..7b88edb --- /dev/null +++ b/src/pfor/index/property/traits.h @@ -0,0 +1,158 @@ +#ifndef PFOR_PFOR_INDEX_PROPERTY_TRAITS_H +#define PFOR_PFOR_INDEX_PROPERTY_TRAITS_H + +#include "../../mp/pack.h" + +#include "../index.h" + +namespace pfor { +namespace index { + +/** + * @brief test if a property set contains another property set + * + * @param P the property set + * @param Q the tested property set + * + * @return true if Q in P + */ +template +struct ContainsProperties { + static constexpr bool value = If, PackContainsAll, std::false_type>::value; +}; + +template +constexpr bool containsProperties = ContainsProperties::value; + +/** + * @brief test if an index has some properties + * + * @param Index the index + * @param Q the property set + * + * @return true if the Index properties contain Q + */ +template struct HasProperties: std::false_type {}; + +template +struct HasProperties, Q> { + static constexpr bool value = containsProperties; +}; + +template +constexpr bool hasProperties = HasProperties::value; + +/** + * @brief computes new properties + * + * @param P a property of L + * @param O operator + * @param L left properties + * @param R right properties + * + * @return new properties + */ +template +struct ComputeProperty { + using type = Pack<>; +}; + +template +using ComputePropertyT = typename ComputeProperty::type; + +/** + * @brief computes new properties + * + * @param P a property of S + * @param S the properties set + * + * @return infered properties + */ +template +struct InferProperty { + using type = Pack<>; +}; + +template +using InferPropertyT = typename InferProperty::type; + + +template struct GeneratePropertiesImpl; + +template +struct GeneratePropertiesImpl, L, R> { + using type = PackUnion, typename GeneratePropertiesImpl, L, R>::type>; +}; + +template +struct GeneratePropertiesImpl, L, R> { + using type = Pack<>; +}; + +template +using GenerateProperties = typename GeneratePropertiesImpl::type; + + +template struct InferPropertiesImpl; + +template +struct InferPropertiesImpl, S> { + using type = PackUnion, typename InferPropertiesImpl, S>::type>; +}; + +template +struct InferPropertiesImpl, S> { + using type = Pack<>; +}; + +template +using InferProperties = typename InferPropertiesImpl::type; + +/** + * @brief computes new properties + * + * @param O operator + * @param L left properties + * @param R right properties + * + * @return new properties + */ +template +struct ComputePropertiesImpl { + using NewProperties = GenerateProperties; + + template struct InferWhileNewProperties; + + template + struct InferWhileNewProperties { + using InferedProperties = InferProperties