esiaccel 0.1.3.dev254__cp312-cp312-win_amd64.whl → 0.1.4__cp312-cp312-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of esiaccel might be problematic. Click here for more details.

esiaccel/CosimBackend.dll CHANGED
Binary file
esiaccel/CosimBackend.lib CHANGED
Binary file
Binary file
Binary file
Binary file
Binary file
esiaccel/accelerator.py CHANGED
@@ -41,6 +41,13 @@ class AcceleratorConnection:
41
41
  def get_service_hostmem(self) -> cpp.HostMem:
42
42
  return self.cpp_accel.get_service_hostmem()
43
43
 
44
+ def get_accelerator(self) -> "Accelerator":
45
+ """
46
+ Return an accelerator that may be owned by this accelerator connection.
47
+ If no accelerator is owned, will throw.
48
+ """
49
+ return Accelerator(self.cpp_accel.get_accelerator())
50
+
44
51
 
45
52
  from .esiCppAccel import HostMemOptions
46
53
 
Binary file
@@ -49,7 +49,8 @@ class AppIDPath : public std::vector<AppID> {
49
49
  public:
50
50
  using std::vector<AppID>::vector;
51
51
 
52
- AppIDPath operator+(const AppIDPath &b);
52
+ AppIDPath operator+(const AppIDPath &b) const;
53
+ AppIDPath parent() const;
53
54
  std::string toStr() const;
54
55
  };
55
56
  bool operator<(const AppIDPath &a, const AppIDPath &b);
@@ -105,13 +106,24 @@ public:
105
106
  /// Adopts the data vector buffer.
106
107
  MessageData() = default;
107
108
  MessageData(std::vector<uint8_t> &data) : data(std::move(data)) {}
109
+ MessageData(std::vector<uint8_t> &&data) : data(std::move(data)) {}
108
110
  MessageData(const uint8_t *data, size_t size) : data(data, data + size) {}
109
111
  ~MessageData() = default;
110
112
 
111
113
  const uint8_t *getBytes() const { return data.data(); }
114
+
115
+ /// Get the data as a vector of bytes.
116
+ const std::vector<uint8_t> &getData() const { return data; }
117
+
118
+ /// Move the data out of this object.
119
+ std::vector<uint8_t> takeData() { return std::move(data); }
120
+
112
121
  /// Get the size of the data in bytes.
113
122
  size_t getSize() const { return data.size(); }
114
123
 
124
+ /// Returns true if this message contains no data.
125
+ bool empty() const { return data.empty(); }
126
+
115
127
  /// Cast to a type. Throws if the size of the data does not match the size of
116
128
  /// the message. The lifetime of the resulting pointer is tied to the lifetime
117
129
  /// of this object.
@@ -124,7 +124,8 @@ public:
124
124
  uint32_t size;
125
125
  };
126
126
 
127
- MMIO(AcceleratorConnection &, const HWClientDetails &clients);
127
+ MMIO(AcceleratorConnection &, const AppIDPath &idPath,
128
+ const HWClientDetails &clients);
128
129
  virtual ~MMIO() = default;
129
130
 
130
131
  /// Read a 64-bit value from the global MMIO space.
@@ -284,6 +285,7 @@ public:
284
285
  std::mutex callMutex;
285
286
  WriteChannelPort *arg;
286
287
  ReadChannelPort *result;
288
+ bool connected = false;
287
289
  };
288
290
 
289
291
  private:
@@ -307,8 +309,9 @@ public:
307
309
  PortMap channels);
308
310
 
309
311
  public:
310
- static Callback *get(AcceleratorConnection &acc, AppID id, BundleType *type,
311
- WriteChannelPort &result, ReadChannelPort &arg);
312
+ static Callback *get(AcceleratorConnection &acc, AppID id,
313
+ const BundleType *type, WriteChannelPort &result,
314
+ ReadChannelPort &arg);
312
315
 
313
316
  /// Connect a callback to code which will be executed when the accelerator
314
317
  /// invokes the callback. The 'quick' flag indicates that the callback is
esiaccel/types.py CHANGED
@@ -448,14 +448,27 @@ class FunctionPort(BundlePort):
448
448
  self.cpp_port.connect()
449
449
  self.connected = True
450
450
 
451
- def call(self, **kwargs: Any) -> Future:
451
+ def call(self, *args: Any, **kwargs: Any) -> Future:
452
452
  """Call the function with the given argument and returns a future of the
453
453
  result."""
454
- valid, reason = self.arg_type.is_valid(kwargs)
454
+
455
+ # Accept either positional or keyword arguments, but not both.
456
+ if len(args) > 0 and len(kwargs) > 0:
457
+ raise ValueError("cannot use both positional and keyword arguments")
458
+
459
+ # Handle arguments: for single positional arg, unwrap it from tuple
460
+ if len(args) == 1:
461
+ selected = args[0]
462
+ elif len(args) > 1:
463
+ selected = args
464
+ else:
465
+ selected = kwargs
466
+
467
+ valid, reason = self.arg_type.is_valid(selected)
455
468
  if not valid:
456
469
  raise ValueError(
457
- f"'{kwargs}' cannot be converted to '{self.arg_type}': {reason}")
458
- arg_bytes: bytearray = self.arg_type.serialize(kwargs)
470
+ f"'{selected}' cannot be converted to '{self.arg_type}': {reason}")
471
+ arg_bytes: bytearray = self.arg_type.serialize(selected)
459
472
  cpp_future = self.cpp_port.call(arg_bytes)
460
473
  return MessageFuture(self.result_type, cpp_future)
461
474
 
esiaccel/utils.py CHANGED
@@ -4,6 +4,7 @@
4
4
 
5
5
  from . import codegen
6
6
 
7
+ import platform
7
8
  from pathlib import Path
8
9
  import subprocess
9
10
  import sys
@@ -13,16 +14,23 @@ _thisdir = Path(__file__).absolute().resolve().parent
13
14
 
14
15
  def run_esiquery():
15
16
  """Run the esiquery executable with the same arguments as this script."""
16
- esiquery = _thisdir / "bin" / "esiquery"
17
+ if platform.system() == "Windows":
18
+ esiquery = _thisdir / "esiquery.exe"
19
+ else:
20
+ esiquery = _thisdir / "bin" / "esiquery"
17
21
  return subprocess.call([esiquery] + sys.argv[1:])
18
22
 
19
23
 
20
24
  def run_esi_cosim():
21
25
  """Run the esi-cosim.py script with the same arguments as this script."""
22
26
  import importlib.util
23
- esi_cosim = _thisdir / "bin" / "esi-cosim.py"
27
+ if platform.system() == "Windows":
28
+ esi_cosim = _thisdir / "esi-cosim.py"
29
+ else:
30
+ esi_cosim = _thisdir / "bin" / "esi-cosim.py"
24
31
  spec = importlib.util.spec_from_file_location("esi_cosim", esi_cosim)
25
32
  assert spec is not None
33
+ assert spec.loader is not None
26
34
  cosim_import = importlib.util.module_from_spec(spec)
27
35
  spec.loader.exec_module(cosim_import)
28
36
  return cosim_import.__main__(sys.argv)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: esiaccel
3
- Version: 0.1.3.dev254
3
+ Version: 0.1.4
4
4
  Summary: ESI accelerators runtime
5
5
  Author-email: John Demme <John.Demme@microsoft.com>
6
6
  License: ==============================================================================
@@ -0,0 +1,43 @@
1
+ esiaccel/CosimBackend.dll,sha256=djHUbGWwpRL86ao4JPMpylX4Am865qkVo8dULY6s80Y,7150592
2
+ esiaccel/CosimBackend.lib,sha256=2qSqISOnyefgUZQPnUoDyDzkpcQVnCf-fjyqLb6aINI,4991546
3
+ esiaccel/ESICppRuntime.dll,sha256=hR80l-2eEBDzVY8BPWsnSXWSdjzsoLEZbvoakl4fr4A,3720192
4
+ esiaccel/ESICppRuntime.lib,sha256=D4u-YAIwkcox2sWcg2glm6fm4iodJ53u-rHZnFKgkec,14529278
5
+ esiaccel/EsiCosimDpiServer.dll,sha256=ZBsB9wzB8N7mYT8JtUow9aue-dAqGLr5t6OU9BNip6A,159744
6
+ esiaccel/EsiCosimDpiServer.lib,sha256=eFEv_EO7-u7vxUTbURwj0d5rwHNoncITR9P2qJAE1Vk,604164
7
+ esiaccel/MtiPli.dll,sha256=-ZSD-sfVPfRsUpvXbbIFHuMx23cGewPoDugJ7cncz6U,14848
8
+ esiaccel/MtiPli.lib,sha256=0vBNn5m9C3ulbl8UJ83c0tuxZAKVrB6_B1bQmBE5jc0,14570
9
+ esiaccel/__init__.py,sha256=C0GLqCQuF5g5qTzmAkf_YAHmBV2XAyiJad3Qz7h8u1g,562
10
+ esiaccel/accelerator.py,sha256=BcXPsUqcQV3YsVVyYbz9P6JnZLlcnuageFbJwID9_3s,3318
11
+ esiaccel/codegen.py,sha256=uoYELtnIabVvgLeCABj-mWras0BvmSKABPH-cd9nDFk,6560
12
+ esiaccel/esi-cosim.py,sha256=GwYfNh4aagypheAhGf0EIX6ojkLYKkc5OMlFR9pfXe8,14381
13
+ esiaccel/esiCppAccel.cp312-win_amd64.pyd,sha256=eQyCiwzLi2KC0qxHx5jClpfDvEAXURhq5WsyifVRFx8,462336
14
+ esiaccel/esiquery.exe,sha256=WytaCYjHn6VdpHgMm6snL1OeAszPvLSUb014yoZsd7k,441856
15
+ esiaccel/types.py,sha256=xR7XbXQ8LqoiiniThYJhqphG813KBNi5d-yHm5bEXtg,17465
16
+ esiaccel/utils.py,sha256=0_A8Jw3M7mjvjTHeV6u00tvRWxLnWKdFq_6NFKTgbVk,1296
17
+ esiaccel/cmake/esiaccelConfig.cmake,sha256=u2aW99k1lEcmYTG1P3BTJqtmDrj53wUUaBz_jzw8kYY,565
18
+ esiaccel/cosim/Cosim_DpiPkg.sv,sha256=9qGn1VyAVrzBP5At1thV6xrovg0WghICD01Zz9J221E,3458
19
+ esiaccel/cosim/Cosim_Endpoint.sv,sha256=ri1fHdkiphe8S2-vm6Ru16rBGYiDiS1c8qeCAsl1diU,6498
20
+ esiaccel/cosim/Cosim_Manifest.sv,sha256=vl9b6XieEkP880IBw1ferekBnDJwFanZZggJJGertXM,1123
21
+ esiaccel/cosim/driver.cpp,sha256=DrEKkSN7Y_Hu7wcaUulH5mbC2L4yB9xLClRMeRUpzHM,3842
22
+ esiaccel/cosim/driver.sv,sha256=ro-j9GM164A1W0MDPkqYfEn3TUKHSqVvgjO31fnloQI,1428
23
+ esiaccel/include/esi/Accelerator.h,sha256=RhkZ2HeMZ0iHc5BkHdDWXoeg9J9lyPQciH5bWq5Qc_w,9772
24
+ esiaccel/include/esi/CLI.h,sha256=Nn8tHn_xtEfkrD7USE2tao6ktYOJ6xcbnhZkS9-ox0A,2540
25
+ esiaccel/include/esi/Common.h,sha256=pR2cqBEgKRYeJsHatjE7MC5WAw9SGbcO-JOyIGjIwF8,5503
26
+ esiaccel/include/esi/Context.h,sha256=Tk_4nBDtTeVY62GfX4Cs_ZMIQstjSgrWHddN_PKANEA,2396
27
+ esiaccel/include/esi/Design.h,sha256=mU8OwpCYijiWSdDq17l45LMzZxBca93nosudWCXNHfQ,4922
28
+ esiaccel/include/esi/Engines.h,sha256=bbGbhXjYMpIpXh_DR0OS57zyGQUIDXh_S7xHX3su0Y0,4831
29
+ esiaccel/include/esi/Logging.h,sha256=sHqMcpp0lNIHkIEyvSm-BBWx4zXXh6NOATCgZpgzYI4,8944
30
+ esiaccel/include/esi/Manifest.h,sha256=j3v9UA0ogtJQBlv6k5s4j_3sCsq-gwF9btVg5dKTBlg,2244
31
+ esiaccel/include/esi/Ports.h,sha256=T2WbPBViUSvFbO5Jjxlcp_eGq9jMitguvNnz3O0564U,10543
32
+ esiaccel/include/esi/Services.h,sha256=H7Iq3F3LivSZHblFJmrC8RAU_MftfKAPDtyGBfJ2nP4,14815
33
+ esiaccel/include/esi/Types.h,sha256=P4ExO8-zvm7qQocUmkM_ATIvamxtDZ8JT2ToLkFo1dk,5483
34
+ esiaccel/include/esi/Utils.h,sha256=KPd75GajIFeTBVJocXBjwsJqhbZg-ShWZCIe3oQdBss,3061
35
+ esiaccel/include/esi/backends/Cosim.h,sha256=s7vYd0ra6m1nvk-n37MjvBoGVI-CCUKBt0DU4PKlaHM,2838
36
+ esiaccel/include/esi/backends/RpcServer.h,sha256=WMwnhwU2qnrcglGNeiKg9QQHpkDx1QE1JydKYDK4jqE,1856
37
+ esiaccel/include/esi/backends/Trace.h,sha256=kx4wwLH3a0ndmRUdaDyYGZ1SP83zlpFrk30Nw8ZrJJA,3286
38
+ esiaccel-0.1.4.dist-info/licenses/LICENSE,sha256=vtnVnB8_lN1yPYcA5MeT56R8UsQtBhyzZLBvu_KMf7I,13468
39
+ esiaccel-0.1.4.dist-info/METADATA,sha256=DGjU4nTgJf0HxuiutkUpgE0eF84BjhWKL0mKcQ5CFxo,16141
40
+ esiaccel-0.1.4.dist-info/WHEEL,sha256=8UP9x9puWI0P1V_d7K2oMTBqfeLNm21CTzZ_Ptr0NXU,101
41
+ esiaccel-0.1.4.dist-info/entry_points.txt,sha256=_CuNLV0fyTURxRREFwpzGycifZW_-7-MyuJNEwKK9J8,137
42
+ esiaccel-0.1.4.dist-info/top_level.txt,sha256=fYWTWMDK4PDu4ePQ9NtcFHas2k8-d1kWhTs2avPpgB4,9
43
+ esiaccel-0.1.4.dist-info/RECORD,,
esiaccel/zlib1.dll DELETED
Binary file
@@ -1,44 +0,0 @@
1
- esiaccel/CosimBackend.dll,sha256=Q2wCD-puuHZ2groHBuT9Y0jkDCzczlyEqZJ2hDi-0I4,7150080
2
- esiaccel/CosimBackend.lib,sha256=z37_AHWOiyR9xHPZscK4K6LwDyIQ2PMDohocFPetJ1o,4991546
3
- esiaccel/ESICppRuntime.dll,sha256=FhYuH4ynptRjRehmhnUoklynkKmNMwptl2ZL87APpJw,3682304
4
- esiaccel/ESICppRuntime.lib,sha256=40kY9ZKIA30oXrlCWDuIjIlFe9fjjOlUOvsXqflZ4b8,14489550
5
- esiaccel/__init__.py,sha256=C0GLqCQuF5g5qTzmAkf_YAHmBV2XAyiJad3Qz7h8u1g,562
6
- esiaccel/accelerator.py,sha256=GM2FRZF_8nzAJ_7TSRSw_kaJCYWCHMK-cQD8ZZU8QVs,3071
7
- esiaccel/codegen.py,sha256=uoYELtnIabVvgLeCABj-mWras0BvmSKABPH-cd9nDFk,6560
8
- esiaccel/esiCppAccel.cp312-win_amd64.pyd,sha256=2HlBF7Ro8mAYVHxZb4mhmHltdnTUAUhJDcZljF5cAVg,459776
9
- esiaccel/types.py,sha256=gfUgrX67KYFruX5xsj_wLNJCdwczzLpseyH71M86pW0,17047
10
- esiaccel/utils.py,sha256=nzar3WALJC_RfmM5v0GeUev5So1-EAYuAMxG9jLj3eQ,1062
11
- esiaccel/zlib1.dll,sha256=NYvMJQTK-5KESdqKkFQnaX-UtByF9EACAEXdYIuj80Y,90112
12
- esiaccel/bin/esi-cosim.py,sha256=GwYfNh4aagypheAhGf0EIX6ojkLYKkc5OMlFR9pfXe8,14381
13
- esiaccel/bin/esiquery.exe,sha256=I34D0ct60LtMsKt5eF_8AcDpOBiGf_XUFv8MA91rI0A,441856
14
- esiaccel/cmake/esiaccelConfig.cmake,sha256=u2aW99k1lEcmYTG1P3BTJqtmDrj53wUUaBz_jzw8kYY,565
15
- esiaccel/cosim/Cosim_DpiPkg.sv,sha256=9qGn1VyAVrzBP5At1thV6xrovg0WghICD01Zz9J221E,3458
16
- esiaccel/cosim/Cosim_Endpoint.sv,sha256=ri1fHdkiphe8S2-vm6Ru16rBGYiDiS1c8qeCAsl1diU,6498
17
- esiaccel/cosim/Cosim_Manifest.sv,sha256=vl9b6XieEkP880IBw1ferekBnDJwFanZZggJJGertXM,1123
18
- esiaccel/cosim/driver.cpp,sha256=DrEKkSN7Y_Hu7wcaUulH5mbC2L4yB9xLClRMeRUpzHM,3842
19
- esiaccel/cosim/driver.sv,sha256=ro-j9GM164A1W0MDPkqYfEn3TUKHSqVvgjO31fnloQI,1428
20
- esiaccel/include/esi/Accelerator.h,sha256=RhkZ2HeMZ0iHc5BkHdDWXoeg9J9lyPQciH5bWq5Qc_w,9772
21
- esiaccel/include/esi/CLI.h,sha256=Nn8tHn_xtEfkrD7USE2tao6ktYOJ6xcbnhZkS9-ox0A,2540
22
- esiaccel/include/esi/Common.h,sha256=GyB9S4GJn-1K4bZNWi6Fc5ftKsL2Y362QOsNYuCqk6I,5078
23
- esiaccel/include/esi/Context.h,sha256=Tk_4nBDtTeVY62GfX4Cs_ZMIQstjSgrWHddN_PKANEA,2396
24
- esiaccel/include/esi/Design.h,sha256=mU8OwpCYijiWSdDq17l45LMzZxBca93nosudWCXNHfQ,4922
25
- esiaccel/include/esi/Engines.h,sha256=bbGbhXjYMpIpXh_DR0OS57zyGQUIDXh_S7xHX3su0Y0,4831
26
- esiaccel/include/esi/Logging.h,sha256=sHqMcpp0lNIHkIEyvSm-BBWx4zXXh6NOATCgZpgzYI4,8944
27
- esiaccel/include/esi/Manifest.h,sha256=j3v9UA0ogtJQBlv6k5s4j_3sCsq-gwF9btVg5dKTBlg,2244
28
- esiaccel/include/esi/Ports.h,sha256=T2WbPBViUSvFbO5Jjxlcp_eGq9jMitguvNnz3O0564U,10543
29
- esiaccel/include/esi/Services.h,sha256=NyeuBxBzmZLpDoikQsjI-ih5FfVivfepZU9Bt8oi0CE,14721
30
- esiaccel/include/esi/Types.h,sha256=P4ExO8-zvm7qQocUmkM_ATIvamxtDZ8JT2ToLkFo1dk,5483
31
- esiaccel/include/esi/Utils.h,sha256=KPd75GajIFeTBVJocXBjwsJqhbZg-ShWZCIe3oQdBss,3061
32
- esiaccel/include/esi/backends/Cosim.h,sha256=s7vYd0ra6m1nvk-n37MjvBoGVI-CCUKBt0DU4PKlaHM,2838
33
- esiaccel/include/esi/backends/RpcServer.h,sha256=WMwnhwU2qnrcglGNeiKg9QQHpkDx1QE1JydKYDK4jqE,1856
34
- esiaccel/include/esi/backends/Trace.h,sha256=kx4wwLH3a0ndmRUdaDyYGZ1SP83zlpFrk30Nw8ZrJJA,3286
35
- esiaccel/lib/EsiCosimDpiServer.dll,sha256=VUDrPl3MdskGBHq86iWGnriyD4zqvlxAn3d_rm1duag,159744
36
- esiaccel/lib/EsiCosimDpiServer.lib,sha256=ocuz8E7M9lqKKs28TQGykLVCDbsXgUj2OS_5TYsYVp8,604164
37
- esiaccel/lib/MtiPli.dll,sha256=gGeO9K9Ba1u2-qSG7dmlaTkAPuZfLnX4FSDdnbTvxgE,14848
38
- esiaccel/lib/MtiPli.lib,sha256=mvcL2Bmst64ac3JSSzCpr31ke3MUPFxNXcAhdVmgdq4,14570
39
- esiaccel-0.1.3.dev254.dist-info/licenses/LICENSE,sha256=vtnVnB8_lN1yPYcA5MeT56R8UsQtBhyzZLBvu_KMf7I,13468
40
- esiaccel-0.1.3.dev254.dist-info/METADATA,sha256=mOFUAglmKQpYsdsfbbVSZUot0fYxkgcJd-08Vbr2Mj8,16148
41
- esiaccel-0.1.3.dev254.dist-info/WHEEL,sha256=8UP9x9puWI0P1V_d7K2oMTBqfeLNm21CTzZ_Ptr0NXU,101
42
- esiaccel-0.1.3.dev254.dist-info/entry_points.txt,sha256=_CuNLV0fyTURxRREFwpzGycifZW_-7-MyuJNEwKK9J8,137
43
- esiaccel-0.1.3.dev254.dist-info/top_level.txt,sha256=fYWTWMDK4PDu4ePQ9NtcFHas2k8-d1kWhTs2avPpgB4,9
44
- esiaccel-0.1.3.dev254.dist-info/RECORD,,
File without changes