Skip to content

rocfile: Move file inspection in DriverState::registerFile(...) into UnregisteredFile#12

Closed
kurtmcmillan wants to merge 1 commit into
ROCm:developfrom
kurtmcmillan:unregistered-file
Closed

rocfile: Move file inspection in DriverState::registerFile(...) into UnregisteredFile#12
kurtmcmillan wants to merge 1 commit into
ROCm:developfrom
kurtmcmillan:unregistered-file

Conversation

@kurtmcmillan
Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread rocfile/src/file.h
}
};

class UnregisteredFile {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to try to maintain 1 class per file?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. We already have multiple classes in file.cpp and buffer.cpp (FileMap, and BufferMap).

My rational for putting UnregisteredFile in file.cpp is that I'm (poorly) borrowing the typestate pattern from Rust. A file starts as a UnregisteredFile and becomes a (Registered)File when it is successfully registered. In other words, a UnregisteredFile is a File but with its "unregistered" status/flag indicated by its type.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved comment here in #14

@kurtmcmillan
Copy link
Copy Markdown
Collaborator Author

This PR is from my private fork of hipFile. Unfortunately, our CI is not compatible with this workflow. Moving this PR to #14 which is a branch with this repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants