-
Notifications
You must be signed in to change notification settings - Fork 7
mirの基本操作追加 #183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
lempiji
wants to merge
10
commits into
dlang-jp:master
Choose a base branch
from
lempiji:add-mir
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
mirの基本操作追加 #183
Changes from 8 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
cbdd8cf
mirの基本操作追加
lempiji fbfbf86
メニュー幅溢れ修正
lempiji 30cbb8a
typo修正
lempiji 60925e6
ソースとタイトルを設定
lempiji 7fd5c09
CIエラー対応のためサブパッケージ名修正
lempiji 291b06e
Merge branch 'dlang-jp:master' into add-mir
lempiji 1ee4935
CIエラーのアーキテクチャを除外
lempiji 40e9095
Merge branch 'master' into add-mir
lempiji 102ff82
Update .github/runner.d
lempiji 0f245bd
Merge branch 'master' into add-mir
lempiji 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| name "mir_usage" | ||
| description "A minimal D application." | ||
| authors "lempiji" | ||
| copyright "Copyright © 2023, lempiji" | ||
| license "public domain" | ||
| dependency "mir-algorithm" version="~>3.19.1" | ||
|
|
||
| configuration "library" { | ||
| targetType "library" | ||
| } | ||
|
|
||
| configuration "include-blas" { | ||
| targetType "library" | ||
| dependency "mir-blas" version="~>1.1.14" | ||
| versions "MIRUSAGE_INCLUDE_BLAS" | ||
| } |
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,45 @@ | ||
| /** | ||
| BLAS利用 | ||
|
|
||
| mirのSliceとBLASを合わせて使う方法を整理します。 | ||
| BLASを利用するには、環境に合わせて適切なライブラリを用意する必要があります。 | ||
|
|
||
| Windowsでは既定で Intel MKL が使われます。 | ||
| Posixでは既定で Open BLAS が使われます。 | ||
|
|
||
| Source: $(LINK_TO_SRC thirdparty/mir/source/mir_usage/slice_blas.d) | ||
| Macros: | ||
| TITLE=mirのSliceとBLASを組み合わせて使う例 | ||
| */ | ||
| module mir_usage.slice_blas; | ||
|
|
||
| version (MIRUSAGE_INCLUDE_BLAS): | ||
|
|
||
| /** | ||
| 行列積を計算する方法 | ||
|
|
||
| mir-blasの gemm 関数を利用します | ||
| */ | ||
| unittest | ||
| { | ||
| import mir.ndslice : slice, sliced, transposed; | ||
| import mir.blas : gemm; | ||
|
|
||
| // B = A.x を計算します | ||
| auto A = [ | ||
| 1f, 2, 3, | ||
| 4, 5, 6 | ||
| ].sliced(2, 3); | ||
|
|
||
| auto x = [ | ||
| 1f, 2, 3 | ||
| ].sliced(1, 3); | ||
|
|
||
| auto B = slice!float(A.shape[0], x.shape[0]); | ||
|
|
||
| // 通常のgemmには転置フラグがありますが、transposedの有無を見て適切に処理されます | ||
| gemm(1, A, x.transposed, 0, B); | ||
|
|
||
| assert(B[0, 0] == 14); | ||
| assert(B[1, 0] == 32); | ||
| } |
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.