ホーム › AI.MachineLearning.DirectML › DML_BINDING_PROPERTIES
DML_BINDING_PROPERTIES
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| RequiredDescriptorCount | DWORD | 4 | +0 | +0 | 実行に必要なディスクリプタの個数。 |
| TemporaryResourceSize | ULONGLONG | 8 | +8 | +8 | 一時リソースに必要なサイズ(バイト)。0なら一時リソース不要。 |
| PersistentResourceSize | ULONGLONG | 8 | +16 | +16 | 永続リソースに必要なサイズ(バイト)。0なら永続リソース不要。 |
各言語での定義
#include <windows.h>
// DML_BINDING_PROPERTIES (x64 24 / x86 24 バイト)
typedef struct DML_BINDING_PROPERTIES {
DWORD RequiredDescriptorCount;
ULONGLONG TemporaryResourceSize;
ULONGLONG PersistentResourceSize;
} DML_BINDING_PROPERTIES;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DML_BINDING_PROPERTIES
{
public uint RequiredDescriptorCount;
public ulong TemporaryResourceSize;
public ulong PersistentResourceSize;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DML_BINDING_PROPERTIES
Public RequiredDescriptorCount As UInteger
Public TemporaryResourceSize As ULong
Public PersistentResourceSize As ULong
End Structureimport ctypes
from ctypes import wintypes
class DML_BINDING_PROPERTIES(ctypes.Structure):
_fields_ = [
("RequiredDescriptorCount", wintypes.DWORD),
("TemporaryResourceSize", ctypes.c_ulonglong),
("PersistentResourceSize", ctypes.c_ulonglong),
]#[repr(C)]
pub struct DML_BINDING_PROPERTIES {
pub RequiredDescriptorCount: u32,
pub TemporaryResourceSize: u64,
pub PersistentResourceSize: u64,
}import "golang.org/x/sys/windows"
type DML_BINDING_PROPERTIES struct {
RequiredDescriptorCount uint32
TemporaryResourceSize uint64
PersistentResourceSize uint64
}type
DML_BINDING_PROPERTIES = record
RequiredDescriptorCount: DWORD;
TemporaryResourceSize: UInt64;
PersistentResourceSize: UInt64;
end;const DML_BINDING_PROPERTIES = extern struct {
RequiredDescriptorCount: u32,
TemporaryResourceSize: u64,
PersistentResourceSize: u64,
};type
DML_BINDING_PROPERTIES {.bycopy.} = object
RequiredDescriptorCount: uint32
TemporaryResourceSize: uint64
PersistentResourceSize: uint64struct DML_BINDING_PROPERTIES
{
uint RequiredDescriptorCount;
ulong TemporaryResourceSize;
ulong PersistentResourceSize;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DML_BINDING_PROPERTIES サイズ: 24 バイト(x64)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; RequiredDescriptorCount : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; TemporaryResourceSize : ULONGLONG (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; PersistentResourceSize : ULONGLONG (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DML_BINDING_PROPERTIES
#field int RequiredDescriptorCount
#field int64 TemporaryResourceSize
#field int64 PersistentResourceSize
#endstruct
stdim st, DML_BINDING_PROPERTIES ; NSTRUCT 変数を確保
st->RequiredDescriptorCount = 100
mes "RequiredDescriptorCount=" + st->RequiredDescriptorCount