Skip to content
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

Wrap all opaque types as interfaces #112

Merged
merged 21 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
41bb0c0
Add new API call for New()
klueska Apr 9, 2024
21c88e2
Rearrange where some types / funcs are defined
klueska Apr 9, 2024
982d869
Add an interface to define all methods in the NVML API
klueska Apr 9, 2024
e828eae
Allow nvml.Return to be used as an error
klueska Apr 12, 2024
a1de4c0
Convert Device into an interface instead of a concrete type
klueska Apr 10, 2024
e818572
Convert Unit into an interface instead of a concrete type
klueska Apr 10, 2024
1082707
Convert EventSet into an interface instead of a concrete type
klueska Apr 10, 2024
3577f24
Convert VgpuInstance into an interface instead of a concrete type
klueska Apr 10, 2024
dd2504b
Convert VgpuTypeId into an interface instead of a concrete type
klueska Apr 10, 2024
daa1f3f
Convert GpuInstance into an interface instead of a concrete type
klueska Apr 10, 2024
0646970
Fix API call for GpuInstanceCreateComputeInstanceWithPlacement
klueska Apr 10, 2024
fbdfe74
Convert ComputeInstance into an interface instead of a concrete type
klueska Apr 10, 2024
630d5a6
Fix API call for GpmSampleAlloc
klueska Apr 10, 2024
80b4064
Convert GpmSample into an interface instead of a concrete type
klueska Apr 10, 2024
3d3e863
Convert all uppercase local variables to lowercase
klueska Apr 10, 2024
f01937e
Fix API call for GetVgpuCompatibility
klueska Apr 10, 2024
b34e706
Ensure that exported structs reference interface types not private types
klueska Apr 12, 2024
6f20742
Add ability to generate interfaces and package methods from library
klueska Apr 11, 2024
9a1711a
Add mocks for all interfaces under pkg/nvml/mock
klueska Apr 10, 2024
d72aa68
Add a mock DGXA100 server that implements parts of the NVML interface
klueska Apr 12, 2024
1fa43fd
Replace Library interface with Extensions interface
klueska Apr 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ check: $(CHECK_TARGETS)

# Apply go fmt to the codebase
fmt:
go list -f '{{.Dir}}' $(MODULE)/pkg/... \
go list -f '{{.Dir}}' $(MODULE)/pkg/... $(MODULE)/gen/... \
| xargs gofmt -s -l -w

golangci-lint:
Expand Down Expand Up @@ -144,6 +144,10 @@ bindings: .create-bindings .strip-autogen-comment .strip-nvml-h-linenumber
go fmt types_gen.go; \
cd -> /dev/null
rm -rf $(PKG_BINDINGS_DIR)/nvml.yml $(PKG_BINDINGS_DIR)/cgo_helpers.go $(PKG_BINDINGS_DIR)/types.go $(PKG_BINDINGS_DIR)/_obj
go run $(GEN_BINDINGS_DIR)/generateapi.go \
--sourceDir $(PKG_BINDINGS_DIR) \
--output $(PKG_BINDINGS_DIR)/zz_generated.api.go
make fmt

.strip-autogen-comment: SED_SEARCH_STRING := // WARNING: This file has automatically been generated on
.strip-autogen-comment: SED_REPLACE_STRING := // WARNING: THIS FILE WAS AUTOMATICALLY GENERATED.
Expand All @@ -166,6 +170,7 @@ clean-bindings:
rm -f $(PKG_BINDINGS_DIR)/nvml.go
rm -f $(PKG_BINDINGS_DIR)/nvml.h
rm -f $(PKG_BINDINGS_DIR)/types_gen.go
rm -f $(PKG_BINDINGS_DIR)/zz_generated.api.go

# Update nvml.h from the Anaconda package repository
update-nvml-h: JQ ?= $(DOCKER) run -i --rm -v "$(PWD):$(PWD)" -w "$(PWD)" backplane/jq:latest
Expand Down
Loading