Win32 API 日本語リファレンス
ホームAI.MachineLearning.DirectML › DML_OUTPUT_GRAPH_EDGE_DESC

DML_OUTPUT_GRAPH_EDGE_DESC

構造体
サイズx64: 24 バイト / x86: 16 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
FromNodeIndexDWORD4+0+0出力元ノードのインデックス。
FromNodeOutputIndexDWORD4+4+4出力元ノードにおける出力スロットのインデックス。
GraphOutputIndexDWORD4+8+8グラフ全体の出力のうち、このエッジが対応する出力インデックス。
NameLPSTR8/4+16+12デバッグ用のエッジ名(ASCII文字列)。NULL可。

各言語での定義

#include <windows.h>

// DML_OUTPUT_GRAPH_EDGE_DESC  (x64 24 / x86 16 バイト)
typedef struct DML_OUTPUT_GRAPH_EDGE_DESC {
    DWORD FromNodeIndex;
    DWORD FromNodeOutputIndex;
    DWORD GraphOutputIndex;
    LPSTR Name;
} DML_OUTPUT_GRAPH_EDGE_DESC;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DML_OUTPUT_GRAPH_EDGE_DESC
{
    public uint FromNodeIndex;
    public uint FromNodeOutputIndex;
    public uint GraphOutputIndex;
    public IntPtr Name;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DML_OUTPUT_GRAPH_EDGE_DESC
    Public FromNodeIndex As UInteger
    Public FromNodeOutputIndex As UInteger
    Public GraphOutputIndex As UInteger
    Public Name As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class DML_OUTPUT_GRAPH_EDGE_DESC(ctypes.Structure):
    _fields_ = [
        ("FromNodeIndex", wintypes.DWORD),
        ("FromNodeOutputIndex", wintypes.DWORD),
        ("GraphOutputIndex", wintypes.DWORD),
        ("Name", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct DML_OUTPUT_GRAPH_EDGE_DESC {
    pub FromNodeIndex: u32,
    pub FromNodeOutputIndex: u32,
    pub GraphOutputIndex: u32,
    pub Name: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type DML_OUTPUT_GRAPH_EDGE_DESC struct {
	FromNodeIndex uint32
	FromNodeOutputIndex uint32
	GraphOutputIndex uint32
	Name uintptr
}
type
  DML_OUTPUT_GRAPH_EDGE_DESC = record
    FromNodeIndex: DWORD;
    FromNodeOutputIndex: DWORD;
    GraphOutputIndex: DWORD;
    Name: Pointer;
  end;
const DML_OUTPUT_GRAPH_EDGE_DESC = extern struct {
    FromNodeIndex: u32,
    FromNodeOutputIndex: u32,
    GraphOutputIndex: u32,
    Name: ?*anyopaque,
};
type
  DML_OUTPUT_GRAPH_EDGE_DESC {.bycopy.} = object
    FromNodeIndex: uint32
    FromNodeOutputIndex: uint32
    GraphOutputIndex: uint32
    Name: pointer
struct DML_OUTPUT_GRAPH_EDGE_DESC
{
    uint FromNodeIndex;
    uint FromNodeOutputIndex;
    uint GraphOutputIndex;
    void* Name;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DML_OUTPUT_GRAPH_EDGE_DESC サイズ: 16 バイト(x86)
dim st, 4    ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; FromNodeIndex : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; FromNodeOutputIndex : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; GraphOutputIndex : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; Name : LPSTR (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DML_OUTPUT_GRAPH_EDGE_DESC サイズ: 24 バイト(x64)
dim st, 6    ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; FromNodeIndex : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; FromNodeOutputIndex : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; GraphOutputIndex : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; Name : LPSTR (+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_OUTPUT_GRAPH_EDGE_DESC
    #field int FromNodeIndex
    #field int FromNodeOutputIndex
    #field int GraphOutputIndex
    #field intptr Name
#endstruct

stdim st, DML_OUTPUT_GRAPH_EDGE_DESC        ; NSTRUCT 変数を確保
st->FromNodeIndex = 100
mes "FromNodeIndex=" + st->FromNodeIndex