Пример #1
0
def test_SanitizeKernelPrototype_multiple_spaces():
  """Test that SanitizeKernelPrototype removes double whitespace."""
  assert (
    opencl.SanitizeKernelPrototype(
      """\
  kernel  void   A(global    float*  a) {}
"""
    )
    == """\
kernel void A(global float* a) {}
"""
  )
Пример #2
0
def test_SanitizeKernelPrototype_leading_whitespace():
  """Test that SanitizeKernelPrototype strips leading whitespace."""
  assert (
    opencl.SanitizeKernelPrototype(
      """
kernel void A(global float* a) {}
"""
    )
    == """\
kernel void A(global float* a) {}
"""
  )
Пример #3
0
def test_SanitizeKernelPrototype_empty_input():
    """Test SanitizeKernelPrototype on an empty input."""
    assert opencl.SanitizeKernelPrototype('') == ''