This repository was archived by the owner on Jan 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 90
Added DrawRandomInt() and Message() #511
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
4834454
Rebased.
kuzminrobin c831071
Added __quantum__qis__message__body ( function Message (msg : String)…
kuzminrobin ed30a99
CR changes. Build fix.
kuzminrobin 4df9cef
CR changes.
kuzminrobin 6955e18
CR changes.
kuzminrobin dbaa761
CR changes. Fixed the output.
kuzminrobin 0ba6ab0
Rebased.
kuzminrobin fa6faad
CR Changes.
kuzminrobin d575492
Instrumented the test output to investigate the Linux and Mac test ru…
kuzminrobin 53971d5
Instrumented in more details.
kuzminrobin 86a25c3
Added a fix for Linux and Mac.
kuzminrobin d814407
Removed instrumenting after a fix.
kuzminrobin e9cbe10
CR changes.
kuzminrobin 7f6fd2f
CR changes.
kuzminrobin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
|
|
||
| #include <iostream> | ||
|
|
||
| #include "qirTypes.hpp" | ||
| #include "quantum__qis.hpp" | ||
|
|
||
| // Forward declarations: | ||
| static std::ostream& GetOutputStream(); | ||
|
|
||
| // Public API: | ||
| extern "C" | ||
| { | ||
| void quantum__qis__message__body(QirString* qstr) // NOLINT | ||
| { | ||
| GetOutputStream() << qstr->str << std::endl; | ||
| } | ||
| } // extern "C" | ||
|
|
||
|
|
||
| // Internal API: | ||
| static std::ostream* currentOutputStream = &std::cout; // Log to std::cout by default. | ||
|
|
||
| static std::ostream& GetOutputStream() | ||
| { | ||
| return *currentOutputStream; | ||
| } | ||
|
|
||
|
|
||
| // For test purposes only: | ||
| namespace Quantum // Replace with `namespace Quantum::Qis::Internal` after migration to C++17. | ||
| { | ||
| namespace Qis | ||
| { | ||
| namespace Internal | ||
| { | ||
| std::ostream& SetOutputStream(std::ostream & newOStream) | ||
| { | ||
| std::ostream& oldOStream = *currentOutputStream; | ||
| currentOutputStream = &newOStream; | ||
| return oldOStream; | ||
| } | ||
| } // namespace Internal | ||
| } // namespace Qis | ||
| } // namespace Quantum | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| #pragma once | ||
|
|
||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
|
|
||
| // To be included by the QIS implementation and QIS tests only. | ||
| // Not to be included by parties outside QIS. | ||
|
|
||
| #ifdef _WIN32 | ||
| #define QIR_SHARED_API __declspec(dllexport) | ||
| #else | ||
| #define QIR_SHARED_API | ||
| #endif | ||
|
|
||
| // For test purposes only: | ||
| namespace Quantum // Replace with `namespace Quantum::Qis::Internal` after migration to C++17. | ||
kuzminrobin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| { | ||
| namespace Qis | ||
| { | ||
| namespace Internal | ||
| { | ||
| extern char const excStrDrawRandomInt[]; | ||
|
|
||
| extern std::ostream& SetOutputStream(std::ostream& newOStream); | ||
| void RandomizeSeed(bool randomize); | ||
| int64_t GetLastGeneratedRandomNumber(); | ||
| } // namespace Internal | ||
| } // namespace Qis | ||
| } // namespace Quantum | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.