Skip to content

Removes redundant buffer zeroing in Metal.swift by using init(unsafeUninitializedCapacity:initializingWith:) #30133

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

Merged
merged 4 commits into from
Apr 14, 2020

Conversation

valeriyvan
Copy link
Contributor

@valeriyvan valeriyvan commented Feb 28, 2020

In functions getDefaultSamplePositions and getSamplePositions removes redundant buffer zeroing by using init(unsafeUninitializedCapacity:initializingWith:) instead of init(repeating:count:)

@valeriyvan valeriyvan changed the title Removes redandant buffer zeroing Removes redundant buffer zeroing in Metal.swift by using init(unsafeUninitializedCapacity:initializingWith:) Feb 28, 2020
@milseman
Copy link
Member

milseman commented Mar 4, 2020

@lorentey this is a change against the Metal overlay. What is the best way to review and incorporate these kinds of changes?

@valeriyvan
Copy link
Contributor Author

ping

@milseman
Copy link
Member

@lorentey any news here?

@lorentey
Copy link
Member

@swift-ci test

Copy link
Member

@lorentey lorentey left a comment

Choose a reason for hiding this comment

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

Thanks! This looks good to me.

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - cf95a2f

@lorentey
Copy link
Member

lorentey commented Mar 12, 2020

Ah, it’s missing a call to baseAddress.


16:03:02 FAILED: stdlib/public/Darwin/Metal/OSX/x86_64/Metal.o 
16:03:02 cd /Users/buildnode/jenkins/workspace/swift-PR-osx/branch-master/buildbot_incremental/swift-macosx-x86_64/stdlib/public/Darwin/Metal && /usr/bin/python /Users/buildnode/jenkins/workspace/swift-PR-osx/branch-master/swift/utils/line-directive @/Users/buildnode/jenkins/workspace/swift-PR-osx/branch-master/buildbot_incremental/swift-macosx-x86_64/stdlib/public/Darwin/Metal/a8a9J.txt -- /Users/buildnode/jenkins/workspace/swift-PR-osx/branch-master/buildbot_incremental/swift-macosx-x86_64/./bin/swiftc -c -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -target x86_64-apple-macosx10.9 -resource-dir /Users/buildnode/jenkins/workspace/swift-PR-osx/branch-master/buildbot_incremental/swift-macosx-x86_64/./lib/swift -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/../../../Developer/Library/Frameworks -O -D INTERNAL_CHECKS_ENABLED -D SWIFT_ENABLE_RUNTIME_FUNCTION_COUNTERS -D SWIFT_ENABLE_EXPERIMENTAL_DIFFERENTIABLE_PROGRAMMING -module-cache-path /Users/buildnode/jenkins/workspace/swift-PR-osx/branch-master/buildbot_incremental/swift-macosx-x86_64/./module-cache -no-link-objc-runtime -Xfrontend -sil-verify-all -enable-library-evolution -Xfrontend -enable-ownership-stripping-after-serialization -Xfrontend -enforce-exclusivity=unchecked -module-name Metal -swift-version 5 -swift-version 5 -autolink-force-load -runtime-compatibility-version none -disable-autolinking-runtime-compatibility-dynamic-replacements -warn-swift3-objc-inference-complete -Xfrontend -verify-syntax-tree -warn-implicit-overrides -Fsystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/PrivateFrameworks/ -module-link-name swiftMetal -force-single-frontend-invocation -parse-as-library -I /Users/buildnode/jenkins/workspace/swift-PR-osx/branch-master/buildbot_incremental/swift-macosx-x86_64/./lib/swift/macosx -o /Users/buildnode/jenkins/workspace/swift-PR-osx/branch-master/buildbot_incremental/swift-macosx-x86_64/stdlib/public/Darwin/Metal/OSX/x86_64/Metal.o @/Users/buildnode/jenkins/workspace/swift-PR-osx/branch-master/buildbot_incremental/swift-macosx-x86_64/stdlib/public/Darwin/Metal/a8a9J.txt
16:03:02 
/Users/buildnode/jenkins/workspace/swift-PR-osx/branch-master/swift/stdlib/public/Darwin/Metal/Metal.swift:94:41: error: cannot convert value of type 'UnsafeMutableBufferPointer<MTLSamplePosition>' to expected argument type 'UnsafeMutablePointer<MTLSamplePosition>'
16:03:02             __getDefaultSamplePositions(buf, count: sampleCount)
16:03:02                                         ^
16:03:02 /Users/buildnode/jenkins/workspace/swift-PR-osx/branch-master/swift/stdlib/public/Darwin/Metal/Metal.swift:268:34: error: cannot convert value of type 'UnsafeMutableBufferPointer<MTLSamplePosition>' to expected argument type 'UnsafeMutablePointer<MTLSamplePosition>?'
16:03:02             __getSamplePositions(buf, count: numPositions)
16:03:02                                  ^

@valeriyvan
Copy link
Contributor Author

ping

1 similar comment
@valeriyvan
Copy link
Contributor Author

ping

@lorentey
Copy link
Member

lorentey commented Apr 3, 2020

@swift-ci test

@swift-ci
Copy link
Contributor

swift-ci commented Apr 3, 2020

Build failed
Swift Test OS X Platform
Git Sha - e755dec

@valeriyvan
Copy link
Contributor Author

@lorentey, could you please run tests now?

@lorentey
Copy link
Member

@swift-ci test

@lorentey lorentey merged commit 419c221 into swiftlang:master Apr 14, 2020
@valeriyvan valeriyvan deleted the RemoveRedundantZeroingMetal branch February 20, 2023 08:05
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.

4 participants