mirror of
https://github.com/stevenrobertson/cuburn.git
synced 2025-02-05 11:40:04 -05:00
Add comment
to DSL
This commit is contained in:
parent
32f68ea1d5
commit
4a80d946db
@ -453,6 +453,13 @@ class _LabelFactory(object):
|
||||
self.block.inject(name, Label(name))
|
||||
self.block.code(prefix='%s:' % name, semi=False)
|
||||
|
||||
class Comment(object):
|
||||
"""Add a single-line comment to the PTX output."""
|
||||
def __init__(self, block):
|
||||
self.block = block
|
||||
def __call__(self, comment):
|
||||
self.block.code(op=['// ', comment], semi=False)
|
||||
|
||||
class PTXFragment(object):
|
||||
"""
|
||||
An object containing PTX DSL functions.
|
||||
@ -627,6 +634,7 @@ class _PTXStdLib(PTXFragment):
|
||||
addr=Mem.addr,
|
||||
vec=Mem.vec,
|
||||
label=_LabelFactory(self.block),
|
||||
comment=Comment(self.block),
|
||||
get_gtid=self._get_gtid)
|
||||
|
||||
class PTXModule(object):
|
||||
|
Loading…
Reference in New Issue
Block a user